Remove the /var/log/osa directory if exist 59/48059/2
authorwutianwei <wutianwei1@huawei.com>
Thu, 30 Nov 2017 03:33:11 +0000 (11:33 +0800)
committerYifei Xue <xueyifei@huawei.com>
Thu, 14 Dec 2017 12:21:10 +0000 (12:21 +0000)
generate password again to ensure the password is different everytime

Change-Id: I8c88266e724922301f4411b330d7d7154bfb250e
Signed-off-by: wutianwei <wutianwei1@huawei.com>
deploy/adapters/ansible/roles/config-osa/tasks/main.yml

index 046b25e..9b657fe 100755 (executable)
@@ -7,11 +7,24 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 # #############################################################################
 ---
+- name: remove osa log directory if exist
+  file:
+    path: /var/log/osa/
+    state: absent
+
 - name: create osa log directory
   file:
     path: /var/log/osa/
     state: directory
 
+- name: remove osa user secrets if exist
+  shell: cp -rf /opt/openstack-ansible/etc/openstack_deploy/user_secrets.yml /etc/openstack_deploy/
+
+- name: generate the osa password
+  command: python pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
+  args:
+    chdir: "/opt/openstack-ansible/scripts"
+
 - name: disable kernel update in rt_kvm scenario
   lineinfile:
     dest: /etc/ansible/roles/openstack_hosts/vars/ubuntu-16.04.yml