diff --git a/README b/README index f0fb87ac2c..c8cef00f91 100644 --- a/README +++ b/README @@ -65,12 +65,27 @@ Setting up a new persistent cloud host: - add it into dns - normally in the cloud.fedoraproject.org but it doesn't have to be -2. set up the host/ip in ansible host inventory +2. If needed create a persistent storage disk for the instance: + sudo -i euca-create-volume -z fedoracloud -s + + +3. set up the host/ip in ansible host inventory - add to ansible/inventory/inventory under [persistent-cloud] - either the ip itself or the hostname you want to refer to it as -3. setup the host_vars +4. setup the host_vars - create file named by the hostname or ip you used in the inventory + - for adding persistent volumes add an entry like this into the host_vars file + + volumes: ['-d /dev/vdb vol-BCA33FCD', '-d /dev/vdc vol-DC833F48'] + + for each volume you want to attach to the instance. + + The device names matter - they start at /dev/vdb and increment. However, + they are not reliable IN the instance. You should find the device, partition + it, format it and label the formatted device then mount the device by label + or by UUID. Do not count on the device name being the same each time. + Contents should look like this (remove all the comments) diff --git a/inventory/host_vars/209.132.184.113 b/inventory/host_vars/209.132.184.113 new file mode 100644 index 0000000000..78713997bb --- /dev/null +++ b/inventory/host_vars/209.132.184.113 @@ -0,0 +1,12 @@ +--- +instance_type: m1.xlarge +image: emi-B5BA397D +keypair: admin +security_group: webserver +zone: fedoracloud +hostbase: fedocal-dev- +public_ip: 209.132.184.113 +root_auth_users: skvidal pingou +description: fedocal dev server +volumes: ['-d /dev/vdb vol-5A443ABA'] + diff --git a/inventory/inventory b/inventory/inventory index 8a35d19da2..751df363cd 100644 --- a/inventory/inventory +++ b/inventory/inventory @@ -297,6 +297,8 @@ virthost-comm01.qa.fedoraproject.org [persistent-cloud] # copr-be.cloud.fedoraproject.org 209.132.184.100 +#fedocal.dev.fedoraproject.org +209.132.184.113 [twistedbots] #rhel6 twisted testbot - ticket 3537 diff --git a/playbooks/hosts/fedocal.dev.fedoraproject.org.yml b/playbooks/hosts/fedocal.dev.fedoraproject.org.yml new file mode 100644 index 0000000000..e4e995d617 --- /dev/null +++ b/playbooks/hosts/fedocal.dev.fedoraproject.org.yml @@ -0,0 +1,51 @@ +- name: check/create instance + hosts: 209.132.184.113 + 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.instances[0].id}') + with_items: $volumes + +- name: provision instance + hosts: 209.132.184.113 + 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 + # - name: mount up disk of fedocal persistent storage + # action: mount name=/srv/copr-repo src='LABEL=copr-repo' fstype=ext4 state=mounted + + # open up ports (22, 80, 443) + - name: poke holes in the firewall + action: command lokkit $item + with_items: + - --service=ssh + - --service=https + - --service=http + + # packages needed + - name: add packages for repo + action: yum state=present name=$item + with_items: + - euca2ools + - rsync + - openssh-clients + + handlers: + - include: $handlers/restart_services.yml