summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-10-14 09:57:57 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-10-14 10:09:18 +0200
commit959158ab0457afc4454e637db89f9d16f8aad775 (patch)
tree44870c605e38bfd4026c8a14fdf47c12a8ef420d /ansible
parent2fc91b1dc56823bc615ce0cb19a8ee79645af6a2 (diff)
controller: configuration cleanup
Better define configuration and provide examples. * controller: Unpack results to correct directory, load the configuration from new place, call run_remote with proper arguments, generate 'results.html' with result_stats script. * ansible/run_include: Adjust to better simulate run_remote. * ansible/fedora.yml: Adjust for fixed configuration. * run_remote: Likewise. Also small issues with option parsing fixed. * config.sh.template: Moved as config/config.sh.template. * config/config.sh.template: Copyyed from /config.sh.template, better documented options. * run: Fix typo - use 'while read i' instead of 'for i in'. * config/os/EXAMPLE.sh: New file - exmaple configuration. * private/os/EXAMPLE.yml: Likewise. * config/hosts.template: Likewise. * dist.include: New file with file patterns that should be distributed to test machine. * dist: Distribute only those files which are necessary. * config/.gitignore: New gitignore file.
Diffstat (limited to 'ansible')
-rw-r--r--ansible/fedora.yml27
-rwxr-xr-xansible/run_include3
2 files changed, 12 insertions, 18 deletions
diff --git a/ansible/fedora.yml b/ansible/fedora.yml
index c22ac4b..d96ef90 100644
--- a/ansible/fedora.yml
+++ b/ansible/fedora.yml
@@ -3,34 +3,27 @@
gather_facts: False
hosts: localhost
vars_files:
- - ../private/ostack.yml
-
- vars:
- - keypair: praiskup-test
- - instance_type: a4827976-e727-4135-ba59-7d5fdb9ce4e2
- - security_group: praiskup-dbt
- - image_id: 5fd723b7-e00d-49d3-b17b-65af842d02ab
- - OS_AUTH_URL: http://control.os1.phx2.redhat.com:5000/v2.0
- - OS_TENANT_ID: "{{ os_tenant_id }}"
- - OS_USERNAME: "{{ os_username }}"
- - OS_PASSWORD: "{{ os_nova_password }}"
- - OS_TENANT_NAME: "Developer Experience - Packaging"
+ - "{{ opt_credsfile }}"
tasks:
- name: generate builder name
local_action: shell echo `dd if=/dev/urandom bs=1k count=10 | md5sum ; echo DBTESTS`
register: vm_name
+ - debug: msg="osusername={{ os_username }}"
+
- name: spin it up
- local_action: nova_compute auth_url={{OS_AUTH_URL}}
- flavor_id={{instance_type}} image_id="{{ image_id }}" key_name={{ keypair }}
- login_password={{OS_PASSWORD}} login_tenant_name="{{OS_TENANT_NAME}}"
- login_username={{OS_USERNAME}} security_groups={{security_group}}
+ local_action: nova_compute auth_url={{os_auth_url}}
+ flavor_id={{os_flavor_id}} image_id="{{ os_image_id }}" key_name={{ os_keypair }}
+ login_password={{os_nova_password}} login_tenant_name="{{os_tenant_name}}"
+ login_username={{os_username}} security_groups={{os_security_group}}
wait=yes name="{{vm_name.stdout}}"
register: nova
+ - debug: msg="{{ nova.info.addresses }}"
+
# This is ugly as hell... Hopefully nothing will be changing.
- - local_action: command echo "{{ nova.info.addresses["os1-internal-1425"][1].addr }}"
+ - local_action: command echo "{{ nova.info.addresses[os_network_dev][1].addr }}"
register: machine_ip
- debug: msg="{{ machine_ip.stdout }}"
diff --git a/ansible/run_include b/ansible/run_include
index 1c7cd98..2b6ccfc 100755
--- a/ansible/run_include
+++ b/ansible/run_include
@@ -10,9 +10,10 @@ export playbook=$(readlink -f "$1")
( set -x
cd "$workdir"
- ansible-playbook -i "$workdir/../hosts" \
+ ansible-playbook -i "$workdir/../config/hosts" \
--extra-vars "include_file=$playbook" \
--extra-vars "script_name=dummy" \
+ --extra-vars "opt_tmp_resultdir=/tmp/dtf-$(date +%H%M%S%N)" \
--extra-vars "target=host" \
"dummy-wrapper.yml"
)