https://github.com/masahide/ansible-ansible
ansibleでansibleを入れるためのplaybookを作った。
踏み台サーバー等に入れるときに使うつもり。
roles/ansible/tasks/main.yml
- name: install python (CentOS 6)
yum: name={{item}} enablerepo=epel state=installed
with_items:
- PyYAML
- python-paramiko
- python-jinja2
when: ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0]|int == 6
tags: python
- name: install python26 (CentOS 5)
yum: name={{item}} enablerepo=epel state=installed
with_items:
- python26
- python26-PyYAML
- python26-paramiko
- python26-jinja2
when: ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0]|int == 5
tags: python
- name: git clone ansible
git: repo=git://github.com/ansible/ansible.git
dest={{ ansible_cache_dir }}/ansible
version=v1.3.1
register: git_result
- name: install ansible (CentOS 6)
shell: |
make install
chdir={{ ansible_cache_dir }}/ansible creates=/usr/bin/ansible
when: git_result.changed and ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0]|int == 6
tags: ansible
- name: install ansible (CentOS 5)
shell: |
sed -i 's/^PYTHON=.*/PYTHON=python26/' Makefile &&
make install
chdir={{ ansible_cache_dir }}/ansible creates=/usr/bin/ansible
when: git_result.changed and ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0]|int == 5
tags: ansible