Parameterize Ansible environment vars in Mistral Workflow

Add ansible_env_variables which a user may use to override
any Ansible environment variable. This new parameter is
then merged with the default env variables as set in
ansible_extra_env_variables.

Also adds DEFAULT_FORKS to the default env variables
with a new default of 50. Ansible automatically limits
the number of forks to the number of possible hosts at
runtime so it is not necessary to compute the fork count.

Change-Id: I5d69af146ca6ca8b3d5f78445cd1b47828daa955
Partial-Bug: 1738276
This commit is contained in:
John Fulton
2017-12-14 18:20:24 -05:00
committed by Alex Schultz
parent eb2389c354
commit 97185448b3

View File

@@ -9,6 +9,7 @@ workflows:
input:
- ansible_playbook_verbosity: 0
- ansible_skip_tags: 'package-install,with_pkg'
- ansible_env_variables: {}
- ansible_extra_env_variables:
ANSIBLE_CONFIG: /usr/share/ceph-ansible/ansible.cfg
ANSIBLE_ACTION_PLUGINS: /usr/share/ceph-ansible/plugins/actions/
@@ -18,6 +19,7 @@ workflows:
ANSIBLE_LIBRARY: /usr/share/ceph-ansible/library/
ANSIBLE_SSH_RETRIES: '3'
ANSIBLE_HOST_KEY_CHECKING: 'False'
DEFAULT_FORKS: '50'
- ceph_ansible_extra_vars: {}
- ceph_ansible_playbook: /usr/share/ceph-ansible/site-docker.yml.sample
- node_data_lookup: '{}'
@@ -54,10 +56,6 @@ workflows:
merge_ip_lists:
publish:
ips_list: <% ($.mgr_ips + $.mon_ips + $.osd_ips + $.mds_ips + $.rgw_ips + $.nfs_ips + $.rbdmirror_ips + $.client_ips).toSet() %>
on-success: set_fork_count
set_fork_count:
publish:
fork_count: <% min($.ips_list.count(), 100) %> # don't use >100 forks
on-success: make_fetch_directory
make_fetch_directory:
action: tripleo.files.make_temp_dir
@@ -143,10 +141,9 @@ workflows:
become: true
become_user: root
verbosity: <% $.ansible_playbook_verbosity %>
forks: <% $.fork_count %>
ssh_private_key: <% $.private_key %>
skip_tags: <% $.ansible_skip_tags %>
extra_env_variables: <% $.ansible_extra_env_variables %>
extra_env_variables: <% $.ansible_extra_env_variables.mergeWith($.ansible_env_variables) %>
publish:
output: <% task().result %>
on-complete: purge_fetch_directory