Last active
May 29, 2016 23:26
-
-
Save torumakabe/6c5d8ae296948b8d4070 to your computer and use it in GitHub Desktop.
ansible playbook for a host of OpenStack tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
remote_user: vagrant | |
vars_files: | |
- /vagrant/ansible/vars/env.yml | |
tasks: | |
- name: change /etc/timezone | |
copy: content=Asia/Tokyo dest=/etc/timezone backup=yes | |
register: timezone | |
sudo: yes | |
- name: change timezone | |
command: dpkg-reconfigure -f noninteractive tzdata | |
when: timezone.changed | |
sudo: yes | |
- name: install apt packages | |
apt: pkg="{{item}}" update_cache=yes | |
sudo: yes | |
with_items: | |
- git | |
- build-essential | |
- libffi-dev | |
- python-dev | |
- python-lxml | |
- name: add OpenStack environment variables | |
lineinfile: | |
dest=/home/vagrant/.bashrc | |
regexp="{{item.regexp}}" | |
line="{{item.line}}" | |
backup=yes | |
with_items: | |
- { regexp: "^export OS_TENANT_NAME", line: 'export OS_TENANT_NAME="{{OS_TENANT_NAME}}"' } | |
- { regexp: "^export OS_USERNAME", line: 'export OS_USERNAME="{{OS_USERNAME}}"' } | |
- { regexp: "^export OS_PASSWORD", line: 'export OS_PASSWORD="{{OS_PASSWORD}}"' } | |
- { regexp: "^export OS_AUTH_URL", line: 'export OS_AUTH_URL="{{OS_AUTH_URL}}"' } | |
- { regexp: "^export OS_REGION_NAME", line: 'export OS_REGION_NAME="{{OS_REGION_NAME}}"' } | |
- name: download pip | |
get_url: | |
url=https://bootstrap.pypa.io/get-pip.py | |
dest=/home/vagrant/get-pip.py | |
validate_certs=no | |
- name: install pip | |
command: | |
python get-pip.py | |
chdir=/home/vagrant | |
sudo: yes | |
- name: install OpenStack CLIs | |
command: | |
pip install "{{item}}" | |
sudo: yes | |
with_items: | |
- python-neutronclient | |
- python-novaclient | |
- python-cinderclient | |
- python-keystoneclient | |
- python-swiftclient | |
- python-keystoneclient | |
- python-glanceclient | |
- python-troveclient | |
- python-designateclient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment