User Tools

Site Tools


sysadmin_misc:ansible

Ansible

  • Install roles : ansible-galaxy install -r requirements.yml
  • Update a role : ansible-galaxy remove mysql && ansible-galaxy install -r requirements.yml
  • Run a playbook :
ansible-playbook playbooks/bdd.yml -l bdd1 -t mysql --ask-vault
ansible-playbook playbooks/phpipam.yml -e "target=awhphpipam1 php_reinstall=true" --ask-vault
  • edit a vault protected file : ansible-vault edit mysql-vault.yml
  • Put a private key in vault :
ssl_key : |
  ----- BEGIN PRIVATE KEY -----
  blahblahblah
  blahblahblah
  ----- END PRIVATE KEY -----

and

- copy:
    path: /etc/ssl/private.key
    mode: 0400
    content: '{{ ssl_key }}'

Breaking long lines : https://watson-wilson.ca/blog/2018/07/11/ansible-tips/

sysadmin_misc/ansible.txt · Last modified: 2018/09/25 15:00 (external edit)