Add beaker01 to ansible

This commit is contained in:
Kevin Fenzi 2013-08-12 15:47:12 +00:00
parent ec3cadb1af
commit c89c9de1ac
7 changed files with 154 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
fas_client_groups: packager
freezes: false
sudoers: $private/files/sudo/arm-packager

View file

@ -0,0 +1,12 @@
---
# common items for the releng-* boxes
lvm_size: 50000
mem_size: 4096
num_cpus: 2
# for systems that do not match the above - specify the same parameter in
# the host_vars/$hostname file
tcp_ports: [ 80, 443 ]
fas_client_groups: sysadmin-qa
nrpe_procs_warn: 250
nrpe_procs_crit: 300

View file

@ -0,0 +1,10 @@
---
nm: 255.255.255.0
gw: 10.5.124.254
dns: 10.5.126.21
ks_url: http://10.5.126.23/repo/rhel/ks/kvm-rhel-6
ks_repo: http://10.5.126.23/repo/rhel/RHEL6-x86_64/
volgroup: /dev/Guests00
eth0_ip: 10.5.124.228
vmhost: virthost-comm01.qa.fedoraproject.org
datacenter: phx2

View file

@ -4,6 +4,9 @@
[bkernel]
[buildvmhost]
[beaker]
beaker01.qa.fedoraproject.org
[arm-packager]
arm03-packager01.arm.fedoraproject.org
arm03-packager02.arm.fedoraproject.org

View file

@ -0,0 +1,27 @@
- name: Setup arm-packager hosts
hosts: arm-packager
user: root
gather_facts: True
tags:
- arm-packager
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- ${private}/vars.yml
- ${vars}/${ansible_distribution}.yml
tasks:
# this is how you include other task lists
- include: $tasks/hosts.yml
- include: $tasks/yumrepos.yml
- include: $tasks/base.yml
- include: $tasks/fas_client.yml
- include: $tasks/2fa_client.yml
- include: $tasks/motd.yml
- include: $tasks/sudo.yml
- include: $tasks/rkhunter.yml
- include: $tasks/denyhosts.yml
handlers:
- include: $handlers/restart_services.yml

View file

@ -0,0 +1,46 @@
# create a new beaker server
# NOTE: make sure there is room/space for this server on the vmhost
# NOTE: most of these vars come from group_vars/mirrorlist or from hostvars
- name: make beaker server
hosts: beaker
user: root
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- ${private}/vars.yml
- ${vars}/${ansible_distribution}.yml
tasks:
- include: $tasks/virt_instance_create.yml
handlers:
- include: $handlers/restart_services.yml
- name: make the box be real
hosts: beaker
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- ${private}/vars.yml
- ${vars}/${ansible_distribution}.yml
tasks:
# this is how you include other task lists
- include: $tasks/hosts.yml
- include: $tasks/yumrepos.yml
- include: $tasks/base.yml
- include: $tasks/fas_client.yml
- include: $tasks/2fa_client.yml
- include: $tasks/collectd/client.yml
- include: $tasks/motd.yml
- include: $tasks/sudo.yml
- include: $tasks/rkhunter.yml
- include: $tasks/denyhosts.yml
- include: $tasks/nagios_client.yml
handlers:
- include: $handlers/restart_services.yml

View file

@ -0,0 +1,52 @@
# requires --extra-vars="vhost=somevhost fqdn"
#General overview:
# talk to the vhost
# get back list of instances
# add each of their hostnames to an addhoc group
# halt each of them in a second play
# wait for them to die
# third play, reboot the vhost
# wait for vhost to come back
# TO BE DONE - should be fixable w/ansible 0.9
# wait for all of the instances to return(?)
# compare the first list to the second for state info
# how to do this:
# capture output of action: virt command=info before halting guests
# compare to same command after vhost comes back
# ansible 0.9 should allow us to preserve content of two registered variables
# across multiple plays
- name: find instances
hosts: $vhost
user: root
tasks:
- name: get list of guests
action: virt command=list_vms
register: vmlist
- name: add them to myvms_new group
local_action: add_host hostname=$item groupname=myvms_new
with_items: ${vmlist.list_vms}
- name: halt instances
hosts: myvms_new
user: root
serial: 1
tasks:
- name: tell nagios to shush
action: nagios action=silence host=${inventory_hostname_short}
delegate_to: noc01.phx2.fedoraproject.org
- name: echo-y
action: command /sbin/halt -p
ignore_errors: true
# if one of them is down we don't care
- name: wait for them to die
local_action: wait_for port=22 delay=30 timeout=300 state=stopped host=${inventory_hostname}