ceph-mon: Generate initial keyring

Minor fix so that initial keyring can be generated using python3.

Signed-off-by: Ha Phan <thanhha.work@gmail.com>
pull/2832/head v3.2.0beta1
Ha Phan 2018-06-21 16:08:39 +08:00 committed by Sébastien Han
parent b7b8aba47b
commit a7b7735b6f
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
- name: generate monitor initial keyring
local_action:
module: shell
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
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).decode())" | tee {{ fetch_directory }}/monitor_keyring.conf
creates: "{{ fetch_directory }}/monitor_keyring.conf"
register: monitor_keyring
become: false