What is ansible?




Ansible commands for this and that

In no particular order.


Test run a playbook file

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


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'


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

Source: https://github.com/ansible/ansible/issues/3546#issuecomment-21024596


Create multiple users on multiple computers and distribute ssh-keys

See these:




Variation with sudo privileges:



Considerations when creating ssh key-pairs



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 #

 Source: http://codeheaven.io/15-things-you-should-know-about-ansible/


Using playbook debugger for logging per playbook





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




Various sources on the internet. See info inline above.







Stop Spam Harvesters, Join Project Honey Pot


Get a free SSL certificate!


The leading nonprofit defending digital privacy, free speech, and innovation.


The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.


Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.


 43ef5c89 CanonicalUbuntudarktext