1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

test.yml: Tips to try ad hoc Ansible commands

This commit is contained in:
A Holt 2024-08-15 10:00:56 -04:00 committed by root
parent b88a3854df
commit 86fa7bd49c

View file

@ -1,6 +1,13 @@
# TEST ANSIBLE COMMANDS/MODULES IN SECONDS -- BY RUNNING: # TEST ANSIBLE COMMANDS/MODULES IN SECONDS -- BY RUNNING:
# ansible-playbook -i ansible_hosts test.yml --connection=local # ansible-playbook -i ansible_hosts test.yml --connection=local
# TEST A SINGLE ANSIBLE COMMAND/MODULE:
# ansible localhost -m ansible.builtin.setup | grep -e "ansible_machine\b" -e ansible_architecture
# ansible localhost -m ansible.builtin.shell -a 'echo $TERM'
# ansible localhost -m ansible.builtin.copy -a "src=/etc/hosts dest=/tmp/hosts"
# ansible localhost -m ansible.builtin.systemd -a "name=nginx state=restarted"
# https://docs.ansible.com/ansible/latest/command_guide/intro_adhoc.html
- hosts: all - hosts: all
become: yes # Optional privilege escalation become: yes # Optional privilege escalation
@ -19,7 +26,9 @@
#- include_role: #- include_role:
# name: 0-init # name: 0-init
# 2024-05-16: ansible-core 2.17 RC2 still hasn't fixed this, as they migrate from Python's crypt library to passlib: # 2024-08-15: Still not working with ansible-core 2.17.3 -- instead of
# migrating from Python's crypt library to passlib, Ansible is deprecating:
# https://github.com/ansible/ansible/issues/81949
# https://github.com/iiab/iiab/blob/485a619bfa082716ec848b5b34893dd3046175a8/roles/cups/tasks/install.yml#L70-L78 # https://github.com/iiab/iiab/blob/485a619bfa082716ec848b5b34893dd3046175a8/roles/cups/tasks/install.yml#L70-L78
#- debug: #- debug:
# msg: "{{ 'changeme' | password_hash('sha512') }}" # msg: "{{ 'changeme' | password_hash('sha512') }}"