< DevOps < Ansible
Ansible offers two keywords for creating loops: loop
and with_<lookup>
.
$ vim create-users.yml --- - name: Create New Users hosts: all gather_facts: false tasks: - name: Create Users Task user: name: "{{ item }}" state: present password: "{{ default_user_password | password_hash('sha512', 'A512') }}" shell: /bin/bash groups: "{{ admin_group }}" append: true loop: - bob - wendy - lofty - dizzy ...
See also
This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.