summaryrefslogtreecommitdiff
path: root/mason/ansible/mason-setup.yml
diff options
context:
space:
mode:
Diffstat (limited to 'mason/ansible/mason-setup.yml')
-rw-r--r--mason/ansible/mason-setup.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml
index 70c7787..08490e7 100644
--- a/mason/ansible/mason-setup.yml
+++ b/mason/ansible/mason-setup.yml
@@ -2,6 +2,7 @@
- hosts: localhost
vars_files:
- "/etc/mason/mason.conf"
+ - "/etc/mason/os.conf"
tasks:
@@ -29,11 +30,38 @@
- fail: msg='CONTROLLERHOST is mandatory'
when: CONTROLLERHOST is not defined
+ - fail: msg='TEST_INFRASTRUCTURE_TYPE is mandatory'
+ when: TEST_INFRASTRUCTURE_TYPE is not defined
+
+ - fail: msg='OPENSTACK_NETWORK_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OPENSTACK_NETWORK_ID is not defined
+
+ - fail: msg='OS_USERNAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_USERNAME is not defined
+
+ - fail: msg='OS_PASSWORD is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_PASSWORD is not defined
+
+ - fail: msg='OS_TENANT_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_ID is not defined
+
+ - fail: msg='OS_TENANT_NAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_NAME is not defined
+
+ - fail: msg='OS_AUTH_URL is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_AUTH_URL is not defined
+
- name: Create the Mason configuration file
template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }}
with_items:
- mason.conf
+ - name: Create the OpenStack credentials file
+ template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }}
+ with_items:
+ - os.conf
+ when: TEST_INFRASTRUCTURE_TYPE == "openstack"
+
- name: Enable the mason service
service: name=mason.service enabled=yes
register: mason_service