Xicheng Chang fa5f106bf6 Revert "Retire stackforge/compass-install"
This reverts commit 2614e5fa95aab680fb6f9287831e50c65f76f72c.

The repository is actually maintained, the authors merely
misunderstood the stackforge namespace retirement maintenance
announcements[1] and didn't realize they needed to notify us of that
status. Reverting the repository to its former state in preparation
for a namespace move in a coming project rename maintenance.

[1] http://lists.openstack.org/pipermail/openstack-infra/2015-August/003119.html

Change-Id: I6ccdcd8f8a084711c265e42c77b3b4159af27b24
2015-11-03 17:37:20 -08:00

61 lines
1.8 KiB
YAML

---
- name: create backup dir
file: path=/root/backup state=directory
- name: create cookbook directory
file: path=/var/chef/cookbooks state=directory
- name: backup cookbooks
shell: cp -rf /var/chef/cookbooks /root/backup/cookbooks
- name: remove cookbooks
shell: rm -rf /var/chef/cookbooks/*
- name: clone compass-adapters
git: repo={{ compass_adapters }} dest=/root/compass-adapters version=dev/experimental accept_hostkey=yes recursive=no
- name: copy cookbooks to its directory
shell: cp -rf /root/compass-adapters/chef/cookbooks/* /var/chef/cookbooks/
- name: upload cookbooks using knife
shell: knife cookbook upload -o /var/chef/cookbooks --all
- name: create roles directory
file: path=/var/chef/roles state=directory
- name: backup roles
shell: cp -rf /var/chef/roles /root/backup/roles
- name: remove roles
shell: rm -rf /var/chef/roles/*
- name: copy roles to its directory
shell: cp -rf /root/compass-adapters/chef/roles/* /var/chef/roles/
- name: upload roles from file
shell: knife role from file /var/chef/roles/*.json
- name: copy compass admin knife client config to chef server
copy: src=compass.json dest=/var/chef/compass.json mode=0644
- name: check if compass client exists
command: knife client list
register: result
- name: remove compass client if it exists
shell: knife client delete compass -y
when: result.stdout.find('compass') != -1
- name: create chef admin client for remote control
shell: knife client create -a compass -f /tmp/compass.pem -y -d
- name: fetch compass.pem
fetch: src=/tmp/compass.pem dest={{ shared_dir }}/keys/compass.pem flat=yes
- name: fetch chef admin.pem
fetch: src=/etc/chef-server/admin.pem dest={{ shared_dir }}/keys/admin.pem flat=yes
- name: fetch chef validator.pem
fetch: src=/etc/chef-server/chef-validator.pem dest={{ shared_dir }}/keys/chef-validator.pem flat=yes