Ansible

Roles aus Galaxy holen

requirements.yml erstellen, Daten rein. Dann installieren mit ansible-galaxy install -r requirements.yml

# Install a role from the Ansible Galaxy
- src: dfarrell07.opendaylight

# Install a role from GitHub
- name: opendaylight
  src: https://github.com/dfarrell07/ansible-opendaylight

# Install a role from a specific git branch
- name: opendaylight
  src: https://github.com/dfarrell07/ansible-opendaylight
  version: origin/master

# Install a role at a specific tag from GitHub
- name: opendaylight
  src: https://github.com/dfarrell07/ansible-opendaylight
  version: 1.0.0

# Install a role at a specific commit from GitHub
- name: opendaylight
  src: https://github.com/dfarrell07/ansible-opendaylight
  version: <commit hash>

Quelle: https://stackoverflow.com/questions/25230376/how-to-automatically-install-ansible-galaxy-roles

Befehl nur ausführen, wenn Datei (nicht) existiert

Geht mit creates:

- name: Initialize etckeeper repository
  shell: etckeeper init
  args:
      creates: /etc/.gitignore

umgekehrt mit removes.