Created
March 13, 2018 21:16
-
-
Save vrutkovs/20bd2b04903e18fcf9b4ef11830000e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/tmp/ansible_test ansible-playbook-3 playbook.yml | |
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' | |
PLAY [localhost] ********************************************************************************************************************************************** | |
TASK [set_fact] *********************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [set_fact] *********************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [debug] ************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"openshift_node_group_labels": [ | |
[ | |
"node-role.kubernetes.io/master='true'", | |
"node-role.kubernetes.io/infra='true'" | |
] | |
] | |
} | |
TASK [set_fact] *********************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [debug] ************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"lbls": [ | |
"node-role.kubernetes.io/master='true'", | |
"node-role.kubernetes.io/infra='true'" | |
] | |
} | |
PLAY RECAP **************************************************************************************************************************************************** | |
localhost : ok=5 changed=0 unreachable=0 failed=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: false | |
tasks: | |
- set_fact: | |
openshift_node_groups: | |
- name: "node-config-master" | |
labels: | |
- node-role.kubernetes.io/master='true' | |
- node-role.kubernetes.io/infra='true' | |
- name: "node-config-node" | |
labels: | |
- node-role.kubernetes.io/compute='true' | |
- set_fact: | |
openshift_node_group_labels: "{{ openshift_node_groups | selectattr('name', 'match', 'node-config-master') | map(attribute='labels') | list }}" | |
- debug: var=openshift_node_group_labels | |
- set_fact: | |
lbls: "{{ openshift_node_group_labels|join(',') }}" | |
- debug: var=lbls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment