What is Ansible...?
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time.
How ansible works?
SSH KEYS ARE YOUR FRIENDS
Passwords are supported, but SSH keys with ssh-agent are one of the best ways to use Ansible. Though if you want to use Kerberos, that's good too. Lots of options! Root logins are not required, you can login as any user, and then su or sudo to any user. when Ansible accesses a remote system it checks for the directory /etc/ansible/facts.d
Ansible's "authorized_key" module is a great way to use ansible to control what machines can access what hosts. Other options, like kerberos or identity management systems, can also be used.
Configure ansible -
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time.
How ansible works?
SSH KEYS ARE YOUR FRIENDS
Passwords are supported, but SSH keys with ssh-agent are one of the best ways to use Ansible. Though if you want to use Kerberos, that's good too. Lots of options! Root logins are not required, you can login as any user, and then su or sudo to any user. when Ansible accesses a remote system it checks for the directory /etc/ansible/facts.d
Ansible's "authorized_key" module is a great way to use ansible to control what machines can access what hosts. Other options, like kerberos or identity management systems, can also be used.
Configure ansible -
- Edit (or create) /etc/ansible/hosts and put one or more remote systems in it.
- Your public SSH key should be located in authorized_keys on those systems.
Important Key Terms related to Ansible -
1. Host Variables-
it is easy to assign variables to hosts that will be used
later in playbooks.
2. Group Variables-
Variables can also be applied to an entire group at once.
4. Default groups -
There are two default groups: all and ungrouped. all contains every host.
ungrouped contains all hosts that don’t have another group aside from all.
Ansible in begining -
Patterns in Ansible are how we decide which hosts to manage. This can mean
what hosts to communicate with, but in terms of Playbooks it actually means what
hosts to apply a particular configuration or IT process to.
We’ll go over how to use the command line in Introduction To Ad-Hoc Commands section,
however, basically it looks like this:
ansible <pattern_goes_here> -m <module_name> -a <arguments>
Such as:
ansible webservers -m service -a "name=httpd state=restarted"
What’s an Playbooks ?
Ad-hoc - An ad-hoc command is something that you might type in to do something really quick, but don’t want to save for later.
Exa - Now to run the command on all servers in a group, in this case, atlanta, in 10 parallel forks:
$ ansible atlanta -a "/sbin/reboot" -f 10
playbook contains one or more plays, which map hosts to a certain function. Ansible does this through something called tasks, which are basically module calls.
Role – it works similar to include.
Exa : - include: intro_example.yml
Comments
Post a Comment