[root@superserver Python-3.11.2]# pip3.11 install -U virtualenv --userCreate a virtualenv
[root@superserver Python-3.11.2]# virtualenv ansible-venvActivate virtualenv and verify python version
[root@superserver Python-3.11.2]# source ansible-venv/bin/activate (ansible-venv) [root@superserver Python-3.11.2]# which python /root/Python-3.11.2/ansible-venv/bin/pythonDeactivate virtualenv
(ansible-venv) [root@superserver Python-3.11.2]# deactivate [root@superserver Python-3.11.2]#
# source ansible-venv/bin/activate # pip3.11 install ansible # ansible --versionIn case you get error
# ansible-galaxy collection install community.awsnote install directory in output
# pip3.11 install -r /home/sysadmin/.ansible/collections/ansible_collections/amazon/aws/requirements.txtInstall amazon.aws collection and its requirements
# ansible-galaxy collection install amazon.aws
# ansible-galaxy collection install amazon.aws ~$ sudo apt upgrade ~$ sudo apt update ~$ sudo apt-get install openssh-server (if not installed already) ~$ sudo apt-get update ~$ which python3 ~$ sudo apt install python3-virtualenv ~$ virtualenv ansible-venv ~$ source ansible-venv/bin/activate ~$ which python3 ~$ deactivate ~$ source ansible-venv/bin/activate ~$ pip3 install ansible ~$ ansible --version ~$ ansible-galaxy collection install community.aws ~$ pip3 install -r /path/of/above/install/requirements.txt ~$ ansible-galaxy collection install amazon.aws ~$ pip3 install -r /path/of/above/install/requirements.txt
# cat test.yaml --- - name: test tags in playbook hosts: localhost gather_facts: no tasks: - name: task1 debug: msg: "Running task1" tags: [ 'debug' ] - name: task to display debug info debug: msg: "display debug info when tag is 'debug'" tags: ['never', 'debug' ]The special tag - "never", will prevent a task from running unless a tag is specifically requested.
# ansible-playbook test.yaml
# ansible-playbook test.yaml --tags debug
# ansible-playbook test.yaml --tags never
https://www.youtube.com/watch?v=z-6Ro8hTSgk
https://docs.ansible.com/ansible/latest/collections/amazon/aws/index.html
https://ndubuisi.hashnode.dev/aws-alb-ansible