This file contains hidden or 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
| - name: "get status?" | |
| ansible.builtin.uri: | |
| url: "{{item}}" | |
| method: GET | |
| # 200 if initialized, unsealed, and active | |
| # 429 if unsealed and standby | |
| # 472 if data recovery mode replication secondary and active | |
| # 473 if performance standby | |
| # 501 if not initialized | |
| # 503 if sealed |
This file contains hidden or 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
| $ pwd | |
| /tmp/reproSo | |
| $ tree -p | |
| [drwxr-xr-x] . | |
| ├── [-rw-r--r--] ansible.cfg | |
| └── [drwxr-xr-x] inventory | |
| ├── [-rw-r--r--] hosts | |
| └── [-rw-r--r--] webservers.ini |
This file contains hidden or 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
| $ pwd | |
| /tmp/so_reproduce | |
| $ cat playbook.yml | |
| --- | |
| - hosts: localhost | |
| gather_facts: false | |
| tasks: | |
| - name: Debug our external var |
This file contains hidden or 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
| $ tree | |
| . | |
| ├── roles | |
| │ └── test_role | |
| │ └── tasks | |
| │ ├── after_fail.yml | |
| │ ├── before_fail.yml | |
| │ ├── induce_fail.yml | |
| │ └── main.yml | |
| └── test_import_role_and_block.yml |
This file contains hidden or 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
| $ cat reg.yaml | |
| - hosts: localhost | |
| gather_facts: false | |
| vars: | |
| myconfig: | |
| kindA: | |
| regexp: "^exampleA.+$" | |
| kindB: | |
| regexp: "^exampleB.+$" |
This file contains hidden or 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
| $ cat test.yml | |
| - hosts: localhost | |
| gather_facts: false | |
| tasks: | |
| - name: Test task | |
| ansible.builtin.debug: | |
| msg: This task runs | |
| loop: [1,2,3,4] | |
| when: item < 3 |
This file contains hidden or 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
| $ ansible --version | |
| ansible [core 2.17.6] | |
| config file = None | |
| configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] | |
| ansible python module location = /home/user/.pyenv/versions/3.13.0/envs/trashso/lib/python3.13/site-packages/ansible | |
| ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections | |
| executable location = /home/user/.pyenv/versions/trashso/bin/ansible | |
| python version = 3.13.0 (main, Nov 9 2024, 10:01:52) [GCC 11.4.0] (/home/user/.pyenv/versions/3.13.0/envs/trashso/bin/python) | |
| jinja version = 3.1.4 | |
| libyaml = True |
This file contains hidden or 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
| $ ansible localhost -e '{"bla": "test"}' -m debug -a "msg={{ bla | type_debug == 'list' }}" | |
| localhost | SUCCESS => { | |
| "msg": false | |
| } | |
| $ ansible localhost -e '{"bla": ["test1", "test2"]}' -m debug -a "msg={{ bla | type_debug == 'list' }}" | |
| localhost | SUCCESS => { | |
| "msg": true | |
| } |
This file contains hidden or 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
| $ date | |
| jeu 22 aoû 2024 18:42:38 CEST | |
| $ crontab -l | |
| CRON_TZ="Europe/London" | |
| 43 18 * * * echo $CRON_TZ > /tmp/toto.txt | |
| $ cat /tmp/toto.txt | |
| cat: /tmp/toto.txt: No such file or directory |
This file contains hidden or 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
| $ pyenv virtualenv 3.12.4 test_ansible_lint | |
| $ pyenv activate test_ansible_lint | |
| (test_ansible_lint)$ pip install ansible ansible-lint | |
| Collecting ansible | |
| Using cached ansible-10.1.0-py3-none-any.whl.metadata (8.2 kB) | |
| Collecting ansible-lint | |
| Using cached ansible_lint-24.6.0-py3-none-any.whl.metadata (5.6 kB) | |
| Collecting ansible-core~=2.17.1 (from ansible) |
NewerOlder