]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Use python instead of python2
authorHa Phan <thanhha.work@gmail.com>
Mon, 4 Jun 2018 09:36:48 +0000 (17:36 +0800)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 4 Jun 2018 12:24:10 +0000 (14:24 +0200)
The initial keyring is generated from ansible server locally and the snippet works well for both v2 and v3 of python.

I don't see any reason why we should explicitly invoke`python2` instead of just `python`.

In some setups, `python2` is not symlinked to `python`; while `python` and `python3` refer to v2 and v3 respectively.

Signed-off-by: Ha Phan <thanhha.work@gmail.com>
roles/ceph-mon/tasks/deploy_monitors.yml

index 1ea0a0503c3958746a95c65eca29646dc1e855aa..391e687c5d30240f025dcd4eb35fe24a871d7a1f 100644 (file)
@@ -2,7 +2,7 @@
 - name: generate monitor initial keyring
   local_action:
     module: shell
-      python2 -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack('<hiih',1,int(time.time()),0,len(key)) ; print base64.b64encode(header + key)" | tee {{ fetch_directory }}/monitor_keyring.conf
+      python -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack('<hiih',1,int(time.time()),0,len(key)) ; print base64.b64encode(header + key)" | tee {{ fetch_directory }}/monitor_keyring.conf
     creates: "{{ fetch_directory }}/monitor_keyring.conf"
   register: monitor_keyring
   become: false