diff options
author | Markos Chandras <mchandras@suse.de> | 2017-09-29 14:23:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-29 14:23:30 +0000 |
commit | 57fcda3cebed64bfc1d5f85761cc3f24853641e7 (patch) | |
tree | 6ae3f3c5d16272d2785c6251166134c1d8450384 /xci/playbooks | |
parent | 07d88170fa827f9907a62d6bdbf3bc0c1ffc90ee (diff) | |
parent | 566eb05ce1e9fb5fc6197a482a0f9dff37a07e94 (diff) |
Merge "Check if /etc/ssl/certs exists before creating it"
Diffstat (limited to 'xci/playbooks')
-rw-r--r-- | xci/playbooks/configure-localhost.yml | 7 | ||||
-rw-r--r-- | xci/playbooks/configure-opnfvhost.yml | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/xci/playbooks/configure-localhost.yml b/xci/playbooks/configure-localhost.yml index 7bbe420b..e242a7ee 100644 --- a/xci/playbooks/configure-localhost.yml +++ b/xci/playbooks/configure-localhost.yml @@ -82,12 +82,17 @@ - name: Load distribution variables include_vars: file: ../var/{{ ansible_os_family }}.yml + - name: check if certificate directory /etc/ssl/certs exists already + stat: path=/etc/ssl/certs + register: check_etc_ssl_certs - name: create certificate directory /etc/ssl/certs + become: true file: path: "/etc/ssl/certs" state: directory - when: ansible_pkg_mgr != 'zypper' + when: check_etc_ssl_certs.stat.exists == false - name: create key directory /etc/ssl/private + become: true file: path: "/etc/ssl/private" state: directory diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml index 3ba2ae12..b6dbbb13 100644 --- a/xci/playbooks/configure-opnfvhost.yml +++ b/xci/playbooks/configure-opnfvhost.yml @@ -113,11 +113,14 @@ command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml" args: chdir: "{{OPENSTACK_OSA_PATH}}/scripts" + - name: check if certificate directory /etc/ssl/certs exists already + stat: path=/etc/ssl/certs + register: check_etc_ssl_certs - name: create certificate directory /etc/ssl/certs file: path: "/etc/ssl/certs" state: directory - when: ansible_pkg_mgr != 'zypper' + when: check_etc_ssl_certs.stat.exists == false - name: create key directory /etc/ssl/private file: path: "/etc/ssl/private" @@ -126,7 +129,6 @@ copy: src: "/etc/ssl/certs/xci.crt" dest: "/etc/ssl/certs/" - become: true - name: read remote key from /etc/ssl/private set_fact: xci_ssl_key: "{{ lookup('pipe', 'sudo cat /etc/ssl/private/xci.key' ) }}" |