run commands on containers when containerized deployments.
(At the moment, all commands are run on the host only)
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
---
- name: update period
- command: radosgw-admin --cluster {{ cluster }} period update --commit
+ command: "{{ docker_exec_cmd }} radosgw-admin --cluster {{ cluster }} period update --commit"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
---
- name: check if the realm already exists
- command: radosgw-admin realm get --rgw-realm={{ rgw_realm }}
+ command: "{{ docker_exec_cmd }} radosgw-admin realm get --rgw-realm={{ rgw_realm }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
register: realmcheck
failed_when: False
check_mode: no
- name: check if the zonegroup already exists
- command: radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}
+ command: "{{ docker_exec_cmd }} radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
register: zonegroupcheck
failed_when: False
check_mode: no
- name: check if the zone already exists
- command: radosgw-admin zone get --rgw-zone={{ rgw_zone }}
+ command: "{{ docker_exec_cmd }} radosgw-admin zone get --rgw-zone={{ rgw_zone }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
register: zonecheck
failed_when: False
check_mode: no
- name: check if the system user already exists
- command: radosgw-admin user info --uid={{ rgw_zone_user }}
+ command: "{{ docker_exec_cmd }} radosgw-admin user info --uid={{ rgw_zone_user }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
register: usercheck
failed_when: False
---
- name: create the realm
- command: radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default
+ command: "{{ docker_exec_cmd }} radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
- "'No such file or directory' in realmcheck.stderr"
- name: create the zonegroup
- command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default
+ command: "{{ docker_exec_cmd }} radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
- "'No such file or directory' in zonegroupcheck.stderr"
- name: create the zone
- command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master
+ command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
- "'No such file or directory' in zonecheck.stderr"
- name: create the zone user
- command: radosgw-admin user create --uid={{ rgw_zone_user }} --display-name="Zone User" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system
+ command: "{{ docker_exec_cmd }} radosgw-admin user create --uid={{ rgw_zone_user }} --display-name=\"Zone User\" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
---
- name: fetch the realm
- command: radosgw-admin realm pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+ command: "{{ docker_exec_cmd }} radosgw-admin realm pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
- "'No such file or directory' in realmcheck.stderr"
- name: fetch the period
- command: radosgw-admin period pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+ command: "{{ docker_exec_cmd }} radosgw-admin period pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when:
- "'No such file or directory' in realmcheck.stderr"
- name: set default realm
- command: radosgw-admin realm default --rgw-realm={{ rgw_realm }}
+ command: "{{ docker_exec_cmd }} radosgw-admin realm default --rgw-realm={{ rgw_realm }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
- name: set default zonegroup
- command: radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }}
+ command: "{{ docker_exec_cmd }} radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
- name: create the zone
- command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default
+ command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when: