mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Added ansible templating example
This commit is contained in:
@@ -2,6 +2,14 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- name: >-
|
||||||
|
Get the values of some special variables.
|
||||||
|
See https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
|
||||||
|
for the full list.
|
||||||
|
debug:
|
||||||
|
var: "{{ item }}"
|
||||||
|
with_items: ["ansible_local", "playbook_dir", "role_path"]
|
||||||
|
|
||||||
- name: >-
|
- name: >-
|
||||||
Remove empty or false values from a list piping it to 'select()'.
|
Remove empty or false values from a list piping it to 'select()'.
|
||||||
Returns ["string"] from ["", "string", 0, false].
|
Returns ["string"] from ["", "string", 0, false].
|
||||||
|
|||||||
@@ -50,6 +50,14 @@ ansible-galaxy remove namespace.role
|
|||||||
## Templating
|
## Templating
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
- name: >-
|
||||||
|
Get the values of some special variables.
|
||||||
|
See https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
|
||||||
|
for the full list.
|
||||||
|
debug:
|
||||||
|
var: "{{ item }}"
|
||||||
|
with_items: ["ansible_local", "playbook_dir", "role_path"]
|
||||||
|
|
||||||
- name: >-
|
- name: >-
|
||||||
Remove empty or false values from a list piping it to 'select()'.
|
Remove empty or false values from a list piping it to 'select()'.
|
||||||
Returns ["string"] from ["", "string", 0, false].
|
Returns ["string"] from ["", "string", 0, false].
|
||||||
@@ -345,12 +353,14 @@ Use the `lookup()` plugin with the `env` option:
|
|||||||
|
|
||||||
- [Roles]
|
- [Roles]
|
||||||
- [Tests]
|
- [Tests]
|
||||||
|
- [Special variables]
|
||||||
- [Automating Helm using Ansible]
|
- [Automating Helm using Ansible]
|
||||||
- [Edit .ini file in other servers using Ansible PlayBook]
|
- [Edit .ini file in other servers using Ansible PlayBook]
|
||||||
- [Yes and No, True and False]
|
- [Yes and No, True and False]
|
||||||
|
|
||||||
[automating helm using ansible]: https://www.ansible.com/blog/automating-helm-using-ansible
|
[automating helm using ansible]: https://www.ansible.com/blog/automating-helm-using-ansible
|
||||||
[roles]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
|
[roles]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
|
||||||
|
[special variables]: https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
|
||||||
[tests]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html
|
[tests]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html
|
||||||
|
|
||||||
[edit .ini file in other servers using ansible playbook]: https://syslint.com/blog/tutorial/edit-ini-file-in-other-servers-using-ansible-playbook/
|
[edit .ini file in other servers using ansible playbook]: https://syslint.com/blog/tutorial/edit-ini-file-in-other-servers-using-ansible-playbook/
|
||||||
|
|||||||
Reference in New Issue
Block a user