Difference between revisions of "Ansible"
m (Added See Also: Ansible APK Module)
m (→Setup hosts: Fixed broken link to Ansible documentation)
|Line 28:||Line 28:|
= Setup hosts =
= Setup hosts =
Add all your remote systems to <code>/etc/ansible/hosts</code>. For details, please refer to [
Add all your remote systems to <code>/etc/ansible/hosts</code>. For details, please refer to [://ansible.//.html#hosts-and-groups Hosts and Groups] in the ansible documentation.
Revision as of 04:56, 10 March 2019
ansible is a simple configuration management, deployment, task-execution, and multinode orchestration framework. It uses SSH for the communication between the involved systems, no server or client daemons are needed, and no additional software beside Python on client boxes is required.
Installation of ansible
ansible is available in testing. The latest package is broken, sorry.
Create a SSH key
Generate a SSH key for the managed node. It's recommended to use a key which is protected with a password.
There are only minimal requirements for the clients. For every system you want to manage, you need to have the client's SSH key in the
authorized_keys file of the management system and Python.
Install the Python package.
Transfer the SSH key
There are two ways to do it. From a default Alpine installation you can use ssh and cat to do it.
If you are planning to use additional features of SSH.
ssh-copy-id, which is provided by the
openssh-client package, can help you with the key setup.
Add all your remote systems to
/etc/ansible/hosts. For details, please refer to Hosts and Groups in the ansible documentation.
Another test is check all variables.
When writing playbooks for Alpine Linux there are modules to keep in mind:
- There is support for OpenRC, the Init System, in the service module.
- service: name: lighttpd enabled: yes state: started
- There is support for APK as of Ansible 2.0.
- apk: name: lighttpd state: present update_cache: yes
- There is support for the Awall firewall as of Ansible 2.4.
- awall: name: policyfile state: enabled activate: yes
- If you are going to re-use playbooks from other Linux distribution, please keep in mind that Alpine Linux uses different paths for the binaries.
The alpine-ansible git repository contain some example playbooks.