From: Zack Cerza Date: Thu, 9 Jul 2015 15:43:27 +0000 (-0600) Subject: Cobbler: update CM repos before running ansible X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F93%2Fhead;p=ceph-cm-ansible.git Cobbler: update CM repos before running ansible Signed-off-by: Zack Cerza --- diff --git a/roles/cobbler/defaults/main.yml b/roles/cobbler/defaults/main.yml index 41475d6d..658c4296 100644 --- a/roles/cobbler/defaults/main.yml +++ b/roles/cobbler/defaults/main.yml @@ -1,4 +1,11 @@ --- +# These defaults are present to allow certain tasks to no-op if a secrets repo +# hasn't been defined. If you want to override these, do so in the secrets repo +# itself. We override these in $repo/ansible/inventory/group_vars/cobbler.yml +secrets_repo: + name: UNDEFINED + url: null + # Where to download ISOs iso_dir: /var/lib/cobbler/isos # Mount point to use for ISOs during import diff --git a/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh b/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh index a884e301..f1cee1c5 100644 --- a/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh +++ b/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh @@ -5,6 +5,7 @@ name=$2 export USER=root export HOME=/root ANSIBLE_CM_PATH=/root/ceph-cm-ansible +SECRETS_REPO_NAME={{ secrets_repo.name }} # Bail if the ssh port isn't open, as will be the case when this is run # while the installer is still running. When this is triggered by @@ -13,7 +14,15 @@ nmap -sT -oG - -p 22 $name | grep 22/open mkdir -p /var/log/ansible +if [ $SECRETS_REPO_NAME != 'UNDEFINED' ] +then + ANSIBLE_SECRETS_PATH=/root/$SECRETS_REPO_NAME + pushd $ANSIBLE_SECRETS_PATH + git pull + popd +fi pushd $ANSIBLE_CM_PATH +git pull export ANSIBLE_SSH_PIPELINING=1 export ANSIBLE_HOST_KEY_CHECKING=False # Tell ansible to create users and populate authorized_keys