added debug to config for ansible -v's and changes how roles are copied to head node
Change-Id: Ib5a5346cf37d95a689d0d7fe354b4a394d0bb241
diff --git a/build.gradle b/build.gradle
index 0cafcef..2bc1e16 100644
--- a/build.gradle
+++ b/build.gradle
@@ -275,6 +275,10 @@
args = args << "--user=$config.seedServer.user"
}
+ if ( config.debug ) {
+ args = args << "-vvvv"
+ }
+
def extraVars = []
if (config.seedServer) {
extraVars = extraVars.p(config.seedServer.extraVars)
@@ -326,6 +330,11 @@
args = args << "--user=$config.seedServer.user"
}
+
+ if ( config.debug ) {
+ args = args << "-vvvv"
+ }
+
def extraVars = []
if (config.seedServer) {
extraVars = extraVars.p(config.seedServer.extraVars)
diff --git a/roles/head-node/files/compute-node.yml b/roles/head-node/files/compute-node.yml
index 4a6a50d..7fb41f0 100644
--- a/roles/head-node/files/compute-node.yml
+++ b/roles/head-node/files/compute-node.yml
@@ -1,4 +1,4 @@
- hosts: all
remote_user: ubuntu
roles:
- - {{ provision.role }}
+ - compute-node
diff --git a/roles/head-node/tasks/main.yml b/roles/head-node/tasks/main.yml
index 8376233..d8067d0 100644
--- a/roles/head-node/tasks/main.yml
+++ b/roles/head-node/tasks/main.yml
@@ -5,23 +5,27 @@
owner=maas
group=maas
state=directory
+ mode=0755
-- name: Ensure Ansible Compute Config Files
+- name: Ensure Ansible Roles
become: yes
- git:
- repo={{ provision.location }}
- dest=/tmp/ansible.maas
- clone=yes
- force=yes
- update=yes
+ copy:
+ src: roles
+ dest: /etc/maas/ansible
+ owner: maas
+ group: maas
+ mode: u=rwX,g=rX,o=rX
+ force: true
-- name: Ensure Ansible Roles Exist
+- name: Ensure Role Permissions and Modes
become: yes
- command: cp -rf /tmp/ansible.maas/{{ provision.role_path }} /etc/maas/ansible
-
-- name: Ensure Ansible Roles Ownership
- become: yes
- file: dest=/etc/maas/ansible/{{ provision.role_path }} owner=maas group=maas recurse=yes
+ file:
+ path: /etc/maas/ansible
+ owner: maas
+ group: maas
+ mode: u=rwX,g=rX,o=rX
+ state: directory
+ recurse: true
- name: Ensure Ansible Provisioning Script
become: yes
diff --git a/roles/head-node/vars/main.yml b/roles/head-node/vars/main.yml
index 0093928..37b7f48 100644
--- a/roles/head-node/vars/main.yml
+++ b/roles/head-node/vars/main.yml
@@ -1,12 +1,2 @@
-provision:
- # CHANGE:
- # 'location' git URL from which to clone a repository that contains the role
- # definitions to be used then provisioning a compute node
- # 'role_path' directory path within the repo that contains the roles.
- # 'role' name of the role to provision for new compute nodes
- location: "{{ prov_location | default('http://gerrit.opencord.org/maas') }}"
- role_path: "{{ prov_role_path | default('roles') }}"
- role: "{{ prov_role | default('compute-node') }}"
-
maas:
user: "{{ maas_user | default('cord') }}"