tripleo-ansible/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml

40 lines
1.7 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: build nodes-uuid command as list
set_fact:
nodes_uuid_list:
- ANSIBLE_LOG_PATH="{{ playbook_dir }}/ceph-ansible/nodes_uuid_command.log"
- ANSIBLE_SSH_CONTROL_PATH_DIR="/tmp/ceph_ansible_control_path"
- ANSIBLE_CONFIG=/usr/share/ceph-ansible/ansible.cfg
- ANSIBLE_REMOTE_TEMP=/tmp/nodes_uuid_tmp
- "{{ calling_ansible_environment_variables|join(' ') }}"
- "{{ ceph_ansible_environment_variables|join(' ') }}"
- ansible-playbook
- '{% if ceph_ansible_private_key_file is defined %}--private-key {{ ceph_ansible_private_key_file }}{% endif %}'
- '-i'
- '{{ playbook_dir }}/ceph-ansible/inventory.yml'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ ansible_python_interpreter }}{% endif %}'
- '{{ playbook_dir }}/ceph-ansible/nodes_uuid_playbook.yml'
- '{% if ceph_ansible_limit is defined and ceph_ansible_limit|length > 0 %}--limit {{ ceph_ansible_limit }}{% endif %}'
- name: run nodes-uuid command
# needs become to be able to read the ssh private key
become: true
shell: "{{ nodes_uuid_list|join(' ') }}"
tags:
- run_uuid_ansible