add fedocal.dev as 209.132.184.113 - add as a persistent host
This commit is contained in:
parent
0b397449dc
commit
e2ca40fe84
4 changed files with 82 additions and 2 deletions
19
README
19
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 <size in gigabytes>
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
|
12
inventory/host_vars/209.132.184.113
Normal file
12
inventory/host_vars/209.132.184.113
Normal file
|
@ -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']
|
||||
|
|
@ -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
|
||||
|
|
51
playbooks/hosts/fedocal.dev.fedoraproject.org.yml
Normal file
51
playbooks/hosts/fedocal.dev.fedoraproject.org.yml
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue