From 260b14ef705011ce4113c34184537c96b5ace4eb Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Fri, 2 Nov 2012 03:44:46 +0000 Subject: [PATCH] add copr-be persistent instance definition --- inventory/host_vars/209.132.184.100 | 3 +- .../hosts/copr-be.cloud.fedoraproject.org.yml | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 playbooks/hosts/copr-be.cloud.fedoraproject.org.yml diff --git a/inventory/host_vars/209.132.184.100 b/inventory/host_vars/209.132.184.100 index c53daac449..537df416f0 100644 --- a/inventory/host_vars/209.132.184.100 +++ b/inventory/host_vars/209.132.184.100 @@ -8,5 +8,4 @@ hostbase: copr-be- public_ip: 209.132.184.00 root_auth_users: skvidal bkabrda description: copr dispatcher and repo server -repovol: vol-BCA33FCD -workvol: vol-DC833F48 +volumes: ['-d /dev/vdb vol-BCA33FCD', '-d /dev/vdc vol-DC833F48] diff --git a/playbooks/hosts/copr-be.cloud.fedoraproject.org.yml b/playbooks/hosts/copr-be.cloud.fedoraproject.org.yml new file mode 100644 index 0000000000..c215d942e9 --- /dev/null +++ b/playbooks/hosts/copr-be.cloud.fedoraproject.org.yml @@ -0,0 +1,47 @@ +- name: check/create instance + hosts: 209.132.184.100 + user: root + gather_facts: False + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - ${private}/vars.yml + + tasks: + - include: $tasks/persistent_cloud.yml + + # attach and mount volumes + - name: attach volumes to the system + local_action: shell euca-attach-volume -i ${inst_res.instances[0].id} $item + only_if: is_set($inst_res) + with_items: $volumes + +- name: provision instance + hosts: 209.132.184.111 + user: root + gather_facts: True + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - ${private}/vars.yml + - ${vars}/${ansible_distribution}.yml + + tasks: + - include: $tasks/cloud_setup_basic.yml + # open up ports (22, 80, 443) + - name: poke holes in the firewall + action: command lokkit $item + with_items: + - --service=ssh + - --service=https + - --service=http + + # setup webserver + - name: add lighttpd + action: yum state=present name=lighttpd + - name: start webserver + action: server state=running enable=1 name=lighttpd + + + handlers: + - include: $handlers/restart_services.yml