Merge pull request #395 from mattt416/make_fetch_configurable

Make fetch directory configurable
pull/396/head
Leseb 2015-08-27 19:27:06 +02:00
commit cc11187430
25 changed files with 86 additions and 20 deletions

View File

@ -4,6 +4,12 @@
# Dummy variable to avoid error because ansible does not recognize the file as a good configuration file when no variable in it.
dummy:
###########
# GENERAL #
###########
#fetch_directory: fetch/
#########
# INSTALL
#########

View File

@ -1,8 +1,15 @@
---
dummy:
###########
# GENERAL #
###########
#cephx: true
#fetch_directory: fetch/
##########
# DOCKER #

View File

@ -33,6 +33,8 @@ dummy:
# - nosizechange
#
#fetch_directory: fetch/
#############
# OPENSTACK #
#############

View File

@ -5,6 +5,12 @@
# Dummy variable to avoid error because ansible does not recognize the file as a good configuration file when no variable in it.
dummy:
###########
# GENERAL #
###########
#fetch_directory: fetch/
####################
# OSD CRUSH LOCATION
####################

View File

@ -4,6 +4,12 @@
# Dummy variable to avoid error because ansible does not recognize the file as a good configuration file when no variable in it.
dummy:
###########
# GENERAL #
###########
#fetch_directory: fetch/
##########
# DOCKER #
##########

View File

@ -1,6 +1,10 @@
---
dummy:
###########
# GENERAL #
###########
## Ceph options
#
#cephx: true
@ -10,6 +14,8 @@ dummy:
# allowing root to not require tty
#radosgw_user: root
#fetch_directory: fetch/
##########
# DOCKER #
##########

View File

@ -1,6 +1,12 @@
---
# You can override vars by using host or group vars
###########
# GENERAL #
###########
fetch_directory: fetch/
###########
# INSTALL #
###########

View File

@ -50,21 +50,21 @@
register: socketrgw
- name: create a local fetch directory if it doesn't exist
local_action: file path=fetch state=directory
local_action: file path={{ fetch_directory }} state=directory
changed_when: false
sudo: false
run_once: true
- name: generate cluster uuid
local_action: shell uuidgen | tee fetch/ceph_cluster_uuid.conf
creates=fetch/ceph_cluster_uuid.conf
local_action: shell uuidgen | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
creates={{ fetch_directory }}/ceph_cluster_uuid.conf
register: cluster_uuid
sudo: false
when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45'
- name: read cluster uuid if it already exists
local_action: command cat fetch/ceph_cluster_uuid.conf
removes=fetch/ceph_cluster_uuid.conf
local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf
removes={{ fetch_directory }}/ceph_cluster_uuid.conf
changed_when: false
register: cluster_uuid
sudo: false

View File

@ -1,6 +1,12 @@
---
# You can override vars by using host or group vars
###########
# GENERAL #
###########
fetch_directory: fetch/
cephx: true

View File

@ -18,7 +18,7 @@
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root

View File

@ -3,7 +3,7 @@
- name: copy mds bootstrap key
copy: >
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring
src={{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring
dest=/var/lib/ceph/bootstrap-mds/ceph.keyring
owner=root
group=root

View File

@ -5,6 +5,8 @@
# GENERAL #
###########
fetch_directory: fetch/
rgw_group_name: rgws
# ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT

View File

@ -36,7 +36,7 @@
- name: copy keys to the ansible server
fetch: >
src={{ item }}
dest=fetch/{{ fsid }}/{{ item }}
dest={{ fetch_directory }}/{{ fsid }}/{{ item }}
flat=yes
with_items:
- "{{ ceph_keys.stdout_lines }}"

View File

@ -1,16 +1,16 @@
---
- name: generate monitor initial keyring
local_action: >
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/monitor_keyring.conf
creates=fetch/monitor_keyring.conf
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
creates={{ fetch_directory }}/monitor_keyring.conf
register: monitor_keyring
sudo: false
when: monitor_secret != 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw=='
- name: read monitor initial keyring if it already exists
local_action: >
command cat fetch/monitor_keyring.conf
removes=fetch/monitor_keyring.conf
command cat {{ fetch_directory }}/monitor_keyring.conf
removes={{ fetch_directory }}/monitor_keyring.conf
changed_when: false
register: monitor_keyring
sudo: false

View File

@ -2,7 +2,7 @@
- name: push ceph files to the ansible server
fetch: >
src={{ item.0 }}
dest=fetch/docker_mon_files/{{ item.0 }}
dest={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
flat=yes
with_together:
- ceph_config_keys

View File

@ -20,7 +20,7 @@
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root

View File

@ -2,6 +2,12 @@
# You can override default vars defined in defaults/main.yml here,
# but I would advice to use host or group vars instead
###########
# GENERAL #
###########
fetch_directory: fetch/
####################
# OSD CRUSH LOCATION
####################

View File

@ -15,7 +15,7 @@
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root

View File

@ -13,7 +13,7 @@
- name: copy osd bootstrap key
copy: >
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring
src={{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring
dest=/var/lib/ceph/bootstrap-osd/ceph.keyring
owner=root
group=root

View File

@ -1,4 +1,11 @@
---
###########
# GENERAL #
###########
fetch_directory: fetch/
##########
# DOCKER #
##########

View File

@ -15,7 +15,7 @@
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root

View File

@ -9,7 +9,7 @@
- name: copy ceph rest api keyring
copy: >
src=fetch/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring
src={{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring
dest=/var/lib/ceph/restapi/ceph-restapi/keyring
owner=root
group=root

View File

@ -1,6 +1,12 @@
---
# You can override vars by using host or group vars
###########
# GENERAL #
###########
fetch_directory: fetch/
## Ceph options
#
cephx: true

View File

@ -15,7 +15,7 @@
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root

View File

@ -12,7 +12,7 @@
- name: copy rados gateway bootstrap key
copy: >
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
src={{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring
owner=root
group=root