ansible/playbooks/groups/loopabull.yml
Adam Miller fc3c0fc112 move loopabull@ start into role, setup handler for template
Signed-off-by: Adam Miller <admiller@redhat.com>
2017-06-01 22:25:42 +00:00

100 lines
2.5 KiB
YAML

# create a new loopabull server
- include: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=loopabull-stg"
- name: make the box be real
hosts: loopabull-stg
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "/srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml"
pre_tasks:
- include: "{{ tasks_path }}/yumrepos.yml"
roles:
- base
- rkhunter
- nagios_client
- hosts
- fas_client
- collectd/base
- sudo
tasks:
- include: "{{ tasks_path }}/2fa_client.yml"
- include: "{{ tasks_path }}/motd.yml"
handlers:
- include: "{{ handlers_path }}/restart_services.yml"
- name: Deploy and configure loopabull
hosts: loopabull-stg
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "/srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml"
handlers:
- include: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: git clone the releng-automation playbook repo
git:
repo: "https://pagure.io/releng-automation.git"
dest: "/usr/local/loopabull-playbooks"
- name: ensure ~/.ssh dir exists
file:
path: "/home/root/.ssh/"
state: directory
- name: place loopabull_ociimage user private keys
copy:
src: "{{ private }}/files/loopabull/keys/{{ env }}_ociimage"
dest: "/home/root/.ssh/id_rsa.loopabull_ociimage"
mode: 0600
- name: Install required packages
package:
name: python-fedmsg-rabbitmq-serializer
state: latest
roles:
- rabbitmq
- fedmsg/base
- fedmsg/hub
- {
role: loopabull,
loglevel: info,
plugin: fedmsgrabbitmq,
routing_keys: [
"org.fedoraproject.prod.buildsys.build.state.change"
],
playbooks_dir: /usr/local/loopabull-playbooks/,
ansible_cfg_path: /etc/ansible/ansible.cfg,
playbook_cmd: /usr/bin/ansible-playbook
}
- name: Post Loopabull install configuration
hosts: loopabull-stg
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "/srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml"
handlers:
- include: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: Enable fedmsg-rabbitmq-serializer
copy:
src: "{{files}}/loopabull/serializer.py"
dest: "/etc/fedmsg.d/serializer.py"
notify: restart fedmsg-hub