summaryrefslogtreecommitdiffstats
path: root/roles/openqa/server
diff options
context:
space:
mode:
authorAdam Williamson <awilliam@redhat.com>2016-10-19 11:17:58 -0700
committerAdam Williamson <awilliam@redhat.com>2016-10-19 11:17:58 -0700
commit33fae65883ace5f5b343ffd86bec78a0aea4bb28 (patch)
tree01472b59e2affa0683e9696ba2d8d6de4d239dac /roles/openqa/server
parent01e2ae3b531902503bbb0d0bd6abc14e661c4f16 (diff)
downloadansible-33fae65883ace5f5b343ffd86bec78a0aea4bb28.tar.gz
ansible-33fae65883ace5f5b343ffd86bec78a0aea4bb28.tar.xz
ansible-33fae65883ace5f5b343ffd86bec78a0aea4bb28.zip
openqa: adjust to new 'fixed' asset stuff on staging
The capability to handle a variance between prod and staging here is just temporary while I'm testing the new fixed asset handling stuff by deploying it on staging. Once it's tested and merged we'll just have prod and staging do the same thing. But for now we need to cleanly handle them having the static disk images in different places.
Diffstat (limited to 'roles/openqa/server')
-rw-r--r--roles/openqa/server/defaults/main.yml1
-rw-r--r--roles/openqa/server/tasks/main.yml10
-rw-r--r--roles/openqa/server/templates/createhdds.j2 (renamed from roles/openqa/server/files/createhdds)2
3 files changed, 10 insertions, 3 deletions
diff --git a/roles/openqa/server/defaults/main.yml b/roles/openqa/server/defaults/main.yml
new file mode 100644
index 000000000..8003a1d58
--- /dev/null
+++ b/roles/openqa/server/defaults/main.yml
@@ -0,0 +1 @@
+openqa_fixed: /var/lib/openqa/share/factory/hdd
diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml
index d3961b1cf..109c4c18e 100644
--- a/roles/openqa/server/tasks/main.yml
+++ b/roles/openqa/server/tasks/main.yml
@@ -16,6 +16,11 @@
# - external_hostname
## string - The public hostname for the server (will be used as ServerName)
## default - ansible_nodename
+# - openqa_fixed
+## string - location for fixed hdd assets; this varies depending on
+## what openQA version is in use. This is a temporary thing
+## while we're testing PR #945 on staging
+## default - /var/lib/openqa/share/factory/hdd
# Optional vars
# - openqa_static_uid
@@ -128,16 +133,17 @@
with_items:
- /var/lib/openqa/share/factory/iso
- /var/lib/openqa/share/factory/hdd
+ - /var/lib/openqa/share/factory/hdd/fixed
- /var/lib/openqa/share/factory/repo
- /var/lib/openqa/share/factory/other
- name: Set up createhdds cron job
- copy: src=createhdds dest=/etc/cron.daily/createhdds owner=root group=root mode=0755
+ template: src=createhdds.j2 dest=/etc/cron.daily/createhdds owner=root group=root mode=0755
- name: Check if any hard disk images need (re)building
command: "/root/openqa_fedora_tools/tools/createhdds.py check"
args:
- chdir: /var/lib/openqa/share/factory/hdd/
+ chdir: "{{ openqa_fixed }}"
register: diskcheck
failed_when: "1 != 1"
changed_when: "1 != 1"
diff --git a/roles/openqa/server/files/createhdds b/roles/openqa/server/templates/createhdds.j2
index 1ba6bd833..39724acbf 100644
--- a/roles/openqa/server/files/createhdds
+++ b/roles/openqa/server/templates/createhdds.j2
@@ -1,4 +1,4 @@
#!/bin/sh
-cd /var/lib/openqa/share/factory/hdd
+cd {{ openqa_fixed }}
LIBGUESTFS_BACKEND=direct withlock /var/lock/createhdds.lock /root/openqa_fedora_tools/tools/createhdds.py all --clean