Ansible configuration

From wikinotes
Revision as of 21:50, 2 November 2019 by Will (talk | contribs) (Created page with "= Files = <blockquote> == /etc/ansible/hosts == This is a .ini file that is composed of groups of hosts. Hosts can be configured with variables, which can be set per-host, or...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Files

/etc/ansible/hosts

This is a .ini file that is composed of groups of hosts. Hosts can be configured with variables, which can be set per-host, or for all hosts within a group. The SSH port is defined by writing a colon followedi by the port number for the entry.

[groupA]
host:8610
host:22

[groupB]
host:22
host       ansible_connection=ssh

[groupB:key]
config_a=value
config_b=value

/etc/ansible/ansible.cfg

The config configures how ansible connects to other machines. Whether sudo passwords are requested, ssh passwords, the number of simulaneous connections, etc.

See http://docs.ansible.com/ansible/intro_configuration.html .

Bootstrapping

Ansible requires that SSH/RPC is enabled on the controlled host, and it generally also requires that python is installed.

As long as you are able to remotely connect to your host, the raw module does not require python to be installed. This means that you can bootstrap chocolatey, python2, and other dependencies onto your machine.

- name: Test BSD Connectivity
  hosts: bsd
  tasks:
     - name:     echo "string" test
       raw:      echo "test"