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 Nov 12, 2015
1 parent af316de commit dbcfa77
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ docs/_build/

# PyBuilder
target/

# generated file
rpcd/playbooks/ansible.cfg
openstack-ansible
rpcd/playbooks/roles/ceph-common
rpcd/playbooks/roles/ceph-mon
rpcd/playbooks/roles/ceph-osd
12 changes: 0 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
[submodule "openstack-ansible"]
path = openstack-ansible
url = https://git.openstack.org/openstack/openstack-ansible
[submodule "rpcd/playbooks/roles/ceph-common"]
path = rpcd/playbooks/roles/ceph-common
url = https://github.com/ceph/ansible-ceph-common
[submodule "rpcd/playbooks/roles/ceph-mon"]
path = rpcd/playbooks/roles/ceph-mon
url = https://github.com/ceph/ansible-ceph-mon
[submodule "rpcd/playbooks/roles/ceph-osd"]
path = rpcd/playbooks/roles/ceph-osd
url = https://github.com/ceph/ansible-ceph-osd
12 changes: 12 additions & 0 deletions ansible-role-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: ceph-common
path: /opt/rpc-openstack/rpcd/playbooks/roles
src: https://github.com/ceph/ansible-ceph-common.git
version: 7d017ea47091b6b081cc672a987709fe6b8390a8
- name: ceph-mon
path: /opt/rpc-openstack/rpcd/playbooks/roles
src: https://github.com/ceph/ansible-ceph-mon.git
version: fbb4e78f77a48fb3da787e05e35e1c727b5b44d3
- name: ceph-osd
path: /opt/rpc-openstack/rpcd/playbooks/roles
src: https://github.com/ceph/ansible-ceph-osd.git
version: 1662cdfd1e6d2aaf2a40e5c8c68811760fbd1f22
1 change: 0 additions & 1 deletion openstack-ansible
Submodule openstack-ansible deleted from 770e02
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: 770e02df1b4d9ca55b1e3bf45b0ee5177ffd0435
1 change: 0 additions & 1 deletion rpcd/playbooks/roles/ceph-common
Submodule ceph-common deleted from 7d017e
1 change: 0 additions & 1 deletion rpcd/playbooks/roles/ceph-mon
Submodule ceph-mon deleted from fbb4e7
1 change: 0 additions & 1 deletion rpcd/playbooks/roles/ceph-osd
Submodule ceph-osd deleted from 1662cd
6 changes: 6 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function run_ansible {
openstack-ansible ${ANSIBLE_PARAMETERS} --forks ${FORKS} $@
}

curl https://raw.githubusercontent.com/pypa/pip/7.1.2/contrib/get-pip.py -o /opt/get-pip.py
python2 /opt/get-pip.py || python /opt/get-pip.py
pip install --force-reinstall 'ansible===1.9.4'
ansible-playbook -i 'localhost,' /opt/rpc-openstack/rpcd/playbooks/repo-fetcher.yml
ansible-galaxy install --role-file=/opt/rpc-openstack/ansible-role-requirements.yml --ignore-errors --force

# begin the bootstrap process
cd ${OA_DIR}

Expand Down
9 changes: 9 additions & 0 deletions scripts/linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ failed=0
## Main ----------------------------------------------------------------------
echo "Running Basic Ansible Lint Check"

# linting is done in a diferent directory
sed -i 's/\/opt/\/home\/travis\/build\/rcbops/g' ansible-role-requirements.yml
sed -i 's/\/opt/\/home\/travis\/build\/rcbops/g' rpcd/playbooks/repo-fetcher.yml

# we need ansible to fetch upstream openstack-ansible
pip2 install --force-reinstall 'ansible===1.9.4'
ansible-playbook -i <(echo '[all]\nlocalhost ansible_connection=local') rpcd/playbooks/repo-fetcher.yml

# Install the development requirements.
if [[ -f "openstack-ansible/dev-requirements.txt" ]]; then
Expand All @@ -32,6 +39,8 @@ else
pip2 install ansible-lint || pip install ansible-lint
fi

ansible-galaxy install --role-file=ansible-role-requirements.yml --ignore-errors --force

# Run hacking/flake8 check for all python files
# Ignores the following rules due to how ansible modules work in general
# F403 'from ansible.module_utils.basic import *' used; unable to detect undefined names
Expand Down
8 changes: 7 additions & 1 deletion scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ BASE_DIR=$( cd "$( dirname ${0} )" && cd ../ && pwd )
OA_DIR="$BASE_DIR/openstack-ansible"
RPCD_DIR="$BASE_DIR/rpcd"

curl https://raw.githubusercontent.com/pypa/pip/7.1.2/contrib/get-pip.py -o /opt/get-pip.py
python2 /opt/get-pip.py || python /opt/get-pip.py
pip install --force-reinstall 'ansible===1.9.4'
ansible-playbook -i 'localhost,' /opt/rpc-openstack/rpcd/playbooks/repo-fetcher.yml
ansible-galaxy install --role-file=/opt/rpc-openstack/ansible-role-requirements.yml --ignore-errors --force

# Merge new overrides into existing user_variables before upgrade
# contents of existing user_variables take precedence over new overrides
cp ${RPCD_DIR}/etc/openstack_deploy/user_variables.yml /tmp/upgrade_user_variables.yml
Expand All @@ -32,7 +38,7 @@ ${OA_DIR}/scripts/bootstrap-ansible.sh

# 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 dbcfa77

Please sign in to comment.