Skip to content

Commit

Permalink
Rework adding new NFS Gateway plugin
Browse files Browse the repository at this point in the history
This commit inverts adding rgw hints and applies some
additional checks.

Change-Id: Ic69125a8bbb7c6bbe9ba76479e2ce6703d02b457
  • Loading branch information
9seconds committed Apr 12, 2017
1 parent e116ddb commit bfcc896
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@

- include: "{{ decapod_common_playbooks }}/plays/deploy_rgw.yaml"


- hosts: nfss
become: true
tasks:
- name: check if Rados Gateway is running
command: pgrep radosgw
register: radosgw_pid
failed_when: false

- name: check if Rados Gateway keyring is present
stat:
path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring"
register: keyring_stat
when: radosgw_pid.rc != 0

- name: fail if Rados Gateway is not installed
fail:
msg: Rados Gateway is required for NFS Gateway
when: not(radosgw_pid.rc == 0 or keyring_stat.stat.exists)


- hosts: nfss
become: true
roles:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
"default_value": True
},
"object_access": {
"description": "Enable NFS object access (nodes should be RGWs)",
"description": "Enable NFS object access",
"typename": "boolean",
"type": "boolean",
"default_value": False
"default_value": True
},
"deploy_rgw": {
"description": "Deploy Rados Gateway on the same machines",
"dont_deploy_rgw": {
"description": "Do not deploy Rados Gateway",
"typename": "boolean",
"type": "boolean",
"default_value": True
"default_value": False
}
}
"""Schema for playbook hints."""
Expand Down Expand Up @@ -137,10 +137,7 @@ def get_inventory_groups(self, cluster, servers, hints):
cluster_servers[item["server_id"]]
for item in cluster.configuration.state if item["role"] == "mons"
]

rgws = []
if hints["deploy_rgw"]:
rgws = servers
rgws = servers if not hints["dont_deploy_rgw"] else []

return {
"mons": mons,
Expand Down

0 comments on commit bfcc896

Please sign in to comment.