Skip to content

Commit

Permalink
remove submodules and use native ansible-y bits
Browse files Browse the repository at this point in the history
  • Loading branch information
prometheanfire committed Feb 8, 2016
1 parent 0f79396 commit ac0cbfb
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ docs/_build/
target/

# generated files
rpcd/playbooks/ansible.cfg
openstack-ansible
rpcd/playbooks/roles/ceph-common
rpcd/playbooks/roles/ceph-mon
rpcd/playbooks/roles/ceph-osd
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ language: python
before_script:
- pip install tox
- pip2 install --force-reinstall 'ansible===1.9.4'
- sed -i 's|/opt|/home/travis/build/rcbops|g' rpcd/playbooks/repo-fetcher.yml
- ansible-playbook -i "localhost," -c local rpcd/playbooks/repo-fetcher.yml
- ansible-galaxy install --role-file=ansible-role-requirements.yml --force --roles-path=/home/travis/build/rcbops/rpc-openstack/rpcd/playbooks/roles

script: tox
Expand Down
1 change: 0 additions & 1 deletion openstack-ansible
Submodule openstack-ansible deleted from e00259
42 changes: 0 additions & 42 deletions rpcd/playbooks/ansible.cfg

This file was deleted.

67 changes: 67 additions & 0 deletions rpcd/playbooks/repo-fetcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
- name: lay the repos down
hosts: localhost
connection: local
gather_facts: false
user: root
tasks:
- name: lay the repos down
git:
dest: "{{ item.value.dest }}"
repo: "{{ item.value.repo }}"
version: "{{ item.value.version }}"
with_dict: "{{repos}}"
- name: generate rpcd ansible.cfg
copy:
dest: /opt/rpc-openstack/rpcd/playbooks/ansible.cfg
content: |
[defaults]
gathering = smart
host_key_checking = False
# Setting forks should be based on your system. The Ansible defaults to 5,
# the os-lxc-hosts assumes that you have a system that can support
# OpenStack, thus it has been conservatively been set to 15
forks = 15
# SSH timeout
timeout = 120
# Set the path to the folder in openstack-ansible which holds the dynamic
# inventory script - new config setting for ansible v1.9 and above
inventory = {{ repos.openstack_ansible.dest }}/playbooks/inventory/
# Set the path to the folder in openstack-ansible which holds the dynamic
# inventory script - uncomment if using ansible below v1.9
#hostfile = {{ repos.openstack_ansible.dest }}/playbooks/inventory/
# Set the path to the folder in openstack-ansible which holds the
# libraries required
library = {{ repos.openstack_ansible.dest }}/playbooks/library/
# Set the path to the folder in openstack-ansible which holds the roles
# that are depended on by the rpc-openstack roles
roles_path = {{ repos.openstack_ansible.dest }}/playbooks/roles/
# Set the path to the folder in openstack-ansible which holds the
# lookup plugins required
lookup_plugins = {{ repos.openstack_ansible.dest }}/playbooks/plugins/lookups/
# Set the path to the folder in openstack-ansible which holds the filter
# plugins required
filter_plugins = {{ repos.openstack_ansible.dest }}/playbooks/plugins/filters/
# Set the path to the folder in openstack-ansible which holds the action
# plugins required
action_plugins = {{ repos.openstack_ansible.dest }}/playbooks/plugins/actions/
[ssh_connection]
pipelining = True
vars:
repos:
openstack_ansible:
dest: /opt/rpc-openstack/openstack-ansible
repo: https://github.com/openstack/openstack-ansible.git
version: e0025962cf09822dce858b5235fce2fdf8a31b94
4 changes: 2 additions & 2 deletions rpcd/playbooks/roles/beaver/tasks/beaver_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
dest: "/etc/init.d/beaver"
owner: "root"
group: "root"
mode: 755
mode: 0755
notify: Restart beaver
tags:
- beaver-install
Expand All @@ -56,7 +56,7 @@
dest: "/etc/logrotate.d/beaver"
owner: "root"
group: "root"
mode: 644
mode: 0644
tags:
- beaver-install
- beaver-logrotate
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
content: "manual\n"
owner: "root"
group: "root"
mode: 644
mode: 0644
tags:
- logstash-web-disable
- logstash-post-install
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cd ${OA_DIR}

# bootstrap ansible and install galaxy roles (needed whether AIO or multinode)
which openstack-ansible || ./scripts/bootstrap-ansible.sh
ansible-playbook -i 'localhost,' /opt/rpc-openstack/rpcd/playbooks/repo-fetcher.yml
ansible-galaxy install --role-file=/opt/rpc-openstack/ansible-role-requirements.yml --force \
--roles-path=/opt/rpc-openstack/rpcd/playbooks/roles

Expand Down
6 changes: 5 additions & 1 deletion scripts/linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
## Shell Opts ----------------------------------------------------------------
set -euo pipefail

# we need to fetch roles
# linting is done in travis, update the path
sed -i 's|/opt|/home/travis/build/rcbops|g' rpcd/playbooks/repo-fetcher.yml

# we need to fetch roles and openstack-ansible
ansible-playbook -i <(echo '[all]\nlocalhost ansible_connection=local') rpcd/playbooks/repo-fetcher.yml
ansible-galaxy install --role-file=ansible-role-requirements.yml --force --roles-path=/home/travis/build/rcbops/rpc-openstack/rpcd/playbooks/roles

python -m tox
3 changes: 2 additions & 1 deletion scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ mv /tmp/upgrade_user_variables.yml /etc/rpc_deploy/user_variables.yml
# Upgrade Ansible in-place so we have access to the patch module.
cd ${OA_DIR}
${OA_DIR}/scripts/bootstrap-ansible.sh
ansible-playbook -i 'localhost,' /opt/rpc-openstack/rpcd/playbooks/repo-fetcher.yml
ansible-galaxy install --role-file=/opt/rpc-openstack/ansible-role-requirements.yml --force
--roles-path=/opt/rpc-openstack/rpcd/playbooks/roles

# Apply any patched files.
cd ${RPCD_DIR}/playbooks
openstack-ansible -i "localhost," patcher.yml
openstack-ansible -i 'localhost,' patcher.yml

# Do the upgrade for openstack-ansible components
cd ${OA_DIR}
Expand Down

0 comments on commit ac0cbfb

Please sign in to comment.