diff --git a/management/defaults/main.yml b/management/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..b59951826fdec5d7c0bd6ed42f15a82468b7ed6c --- /dev/null +++ b/management/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +mgmt_ansible_version: stable-2.3 diff --git a/management/files/ansible.sh b/management/files/ansible.sh new file mode 100644 index 0000000000000000000000000000000000000000..7055d9cca8bf00f32a1f47f06ad13a7bbb790ea7 --- /dev/null +++ b/management/files/ansible.sh @@ -0,0 +1,3 @@ +export PATH="/opt/ansible/bin:/opt/ansible/test/runner:$PATH" +export PYTHONPATH="/opt/ansible/lib:$PYTHONPATH" +export MANPATH="/opt/ansible/docs/man:$MANPATH" diff --git a/management/handlers/main.yml b/management/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..08544cd59bfaa1d4e9b96239dff80bbb35ae4676 --- /dev/null +++ b/management/handlers/main.yml @@ -0,0 +1,12 @@ +--- + +- name: rebuild ansible and its documentation + command: make clean all docs + args: + chdir: /opt/ansible + +- name: rebuild ansible egg info + command: python setup.py egg_info + args: + chdir: /opt/ansible + diff --git a/management/tasks/main.yml b/management/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..79923119fcc0c7df4428b51efc68fb0c67f93e66 --- /dev/null +++ b/management/tasks/main.yml @@ -0,0 +1,58 @@ +--- + +- name: ensure required software for ansible is installed + apt: + name: {{ item }} + state: installed + with_items: + - python-yaml + - python-jinja2 + - python-paramiko + - python-cryptography + - python-sphinx # documentation + - asciidoc # documentation + - squashfs-tools # needed for guest-overlay + tags: + - management + - ansible + +- name: ensure ansible is up to date + git: ansible to opt + dest: /opt/ansible + recursive: yes + repo: https://github.com/ansible/ansible.git + version: {{ mgmt_ansible_version }} + notify: + - rebuild ansible and its documentation + - rebuild ansible egg info + tags: + - management + - ansible + +- name: ensure the environment is set up for running ansible (bash) + copy: + src: ansible.sh + dest: /etc/profile.d/ansible.sh + owner: root + group: root + mode: 0644 + tags: + - management + - ansible + +- name: ensure the environment is set up for running ansible (zsh) + lineinfile: + line: 'source /etc/profile.d/ansible.sh' + path: /etc/zsh/zshenv + state: present + tags: + - management + - ansible + +- name: ensure we can ipmi other hosts + apt: + name: ipmitool + state: installed + tags: + - management +