summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/configure-localhost.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-04-03 12:47:54 +0100
committerMarkos Chandras <mchandras@suse.de>2018-04-04 10:55:12 +0100
commit9fc661b56dbd90df944755140bfff88fb1197fbd (patch)
tree99428d2a69a577ebb14afbdcba82742b2e5284db /xci/playbooks/configure-localhost.yml
parent8199744e9cee88127291b22ebeb9e78142cc4ade (diff)
xci: osa: Use Ansible modules to create ssl certificates
Ansible already provides modules to create ssl certificates so we can use these instead of running the openssl commands directly. Moreover, we can drop all the tasks which create the ssl directories since there are being created by the openssl package which also creates the appropriate symlinks. Finally, there is no need to generate the certificate on localhost if only the OPNFV host consumes it, so move these steps to the appropriate playbook. Change-Id: I0045945c502013be3d76440876e894a44a092690 Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/configure-localhost.yml')
-rw-r--r--xci/playbooks/configure-localhost.yml36
1 files changed, 9 insertions, 27 deletions
diff --git a/xci/playbooks/configure-localhost.yml b/xci/playbooks/configure-localhost.yml
index 1f010528..5f091c92 100644
--- a/xci/playbooks/configure-localhost.yml
+++ b/xci/playbooks/configure-localhost.yml
@@ -69,34 +69,16 @@
path: "{{log_path}}"
state: directory
recurse: no
- - block:
- - 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: check_etc_ssl_certs.stat.exists == false
- - name: create key directory /etc/ssl/private
- become: true
- file:
- path: "/etc/ssl/private"
- state: directory
- - name: generate self signed certificate
- command: openssl req -new -nodes -x509 -subj "{{ xci_ssl_subject }}" -days 3650 -keyout "/etc/ssl/private/xci.key" -out "/etc/ssl/certs/xci.crt" -extensions v3_ca
- become: true
- - name: Synchronize local development OSA repository to XCI paths
- # command module is much faster than the copy module
- synchronize:
- src: "{{ openstack_osa_dev_path }}"
- dest: "{{ xci_cache }}/repos/openstack-ansible"
- recursive: yes
- delete: yes
- when:
- - openstack_osa_dev_path != ""
+
+ - name: Synchronize local development OSA repository to XCI paths
+ # command module is much faster than the copy module
+ synchronize:
+ src: "{{ openstack_osa_dev_path }}"
+ dest: "{{ xci_cache }}/repos/openstack-ansible"
+ recursive: yes
+ delete: yes
when:
+ - openstack_osa_dev_path != ""
- installer_type == "osa"
- name: Configure SSH key for local user