1. What is ansible?


2. Ansible commands for this and that

In no particular order.


2.1. Test run a playbook file

# ansible-playbook playbook.file.yml --check


2.2. Ad-hoc command

Run the command on all members in group centos. For CentOS this is set in /etc/ansible/hosts.

# ansible centos -a 'yum update -y'


2.3. Specify target groups in playbook

Specifying the below in the playbook, will run the commands on the two host groups centos-cli and centos-srv.

- hosts: centos-cli:centos-srv



2.4. Create multiple users on multiple computers and distribute ssh-keys

See these:!topic/ansible-project/t6dsaaxtTyo

Variation with sudo privileges:


2.5. Considerations when creating ssh key-pairs


2.6. Run tasks step by step

Sometimes you don't want to run all tasks in a playbook. Should this be the case you can use the --step flag.

# playbook.yml
- hosts: centos-cli   tasks:     - name: first task       # run some task      - name: second task      # run some other task
# ansible-playbook playbook.yml --step  > Perform task: first task (y/n/c): n ... > Perform task: second task (y/n/c): y #



2.7. Using playbook debugger for logging per playbook!msg/ansible-project/ql6xFaTDcYw/UwdkDuP7BQAJ

This notelett is a work in progress. Need to do some reading...



3. Sources

Various sources on the internet. See info inline above.