diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-09-17 11:42:03 +0100 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-09-17 11:42:03 +0100 |
commit | 0f4f5d119c0deeee4806d33d688e735496a0e7ab (patch) | |
tree | e8027168300e135534d32ac7ce365a8d4a938a54 /mason/ansible/mason-setup.yml | |
parent | 0f11a6cbe1f4a70279c06ecdacaea942db36c209 (diff) | |
parent | 950017e5621bf5eac6ea13e9340194a6559b2bb1 (diff) | |
download | definitions-0f4f5d119c0deeee4806d33d688e735496a0e7ab.tar.gz |
Merge branch 'baserock/pedroalvarez/generic-mason3'
Reviewed-by: Richard Maw
Reviewed-by: Sam Thursfield
Diffstat (limited to 'mason/ansible/mason-setup.yml')
-rw-r--r-- | mason/ansible/mason-setup.yml | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml new file mode 100644 index 00000000..70c77871 --- /dev/null +++ b/mason/ansible/mason-setup.yml @@ -0,0 +1,56 @@ +--- +- hosts: localhost + vars_files: + - "/etc/mason/mason.conf" + tasks: + + + - fail: msg='TROVE_ID is mandatory' + when: TROVE_ID is not defined + + - fail: msg='TROVE_HOST is mandatory' + when: TROVE_HOST is not defined + + - fail: msg='ARTIFACT_CACHE_SERVER is mandatory' + when: ARTIFACT_CACHE_SERVER is not defined + + - fail: msg='MASON_CLUSTER_MORPHOLOGY is mandatory' + when: MASON_CLUSTER_MORPHOLOGY is not defined + + - fail: msg='MASON_DEFINITIONS_REF is mandatory' + when: MASON_DEFINITIONS_REF is not defined + + - fail: msg='MASON_DISTBUILD_ARCH is mandatory' + when: MASON_DISTBUILD_ARCH is not defined + + - fail: msg='MASON_TEST_HOST is mandatory' + when: MASON_TEST_HOST is not defined + + - fail: msg='CONTROLLERHOST is mandatory' + when: CONTROLLERHOST is not defined + + - name: Create the Mason configuration file + template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - mason.conf + + - name: Enable the mason service + service: name=mason.service enabled=yes + register: mason_service + - name: Restart the mason service + service: name=mason.service state=restarted + when: mason_service|changed + + - name: Enable the mason timer + service: name=mason.timer enabled=yes + register: mason_timer + - name: Restart the mason timer + service: name=mason.timer state=restarted + when: mason_timer|changed + + - name: Enable the httpd service + service: name=httpd.service enabled=yes + register: httpd_service + - name: Restart the httpd service + service: name=httpd state=restarted + when: httpd_service|changed |