====== ssh keys cached ====== can be claned in awx_task bash exec -it awx_task bash bash-4.4# vi /root/.ssh/known_hosts ====== Ansible tower using API ====== https://www.unixarena.com/2019/03/ansible-tower-awx-trigger-ansible-job-using-rest-api.html/ https://www.ansible.com/blog/summary-of-authentication-methods-in-red-hat-ansible-tower https://adam.younglogic.com/2018/08/job-tower-rest/ * creat token curl -u user:password -k -X POST https:///api/v2/tokens/ * sample GET hosts curl -k -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ********" \ https://10.11.13.130:9443/api/v2/hosts/ \ | jq curl -k -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ********" \ https://10.11.13.130:9443/api/v2/job_templates//launch/ * rollade01_down curl -k -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ********" \ https://10.11.13.130:9443/api/v2/job_templates/36/launch/ * rolladen up curl -k -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ********" \ https://10.11.13.130:9443/api/v2/job_templates/35/launch/ * run "Demo Project" curl -k -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer *" \ https://10.11.13.130:9443/api/v2/job_templates/7/launch/====== Headline ====== ====== read docs ====== https://www.linuxtechi.com/install-ansible-awx-on-ubuntu/ https://www.unixarena.com/2019/03/ansible-tower-awx-trigger-ansible-job-using-rest-api.html/ https://ansible.github.io/workshops/decks/ansible_network.pdf https://computingforgeeks.com/how-to-install-ansible-awx-on-ubuntu-linux/ https://docs.ansible.com/ansible-tower/2.3.0/html/quickstart/create_project.html ====== Jobs ====== A Job Template requires: ● An Inventory to run the job against ● A Credential to login to devices. ● A Project which contains Ansible Playbooks ====== install awx tower-cli ====== https://www.unixarena.com/2019/03/ansible-tower-awx-installing-configuring-tower-cli.html/ ====== backup awx ====== https://www.unixarena.com/2019/03/backup-restore-ansible-awx-tower-cli.html/ ====== Change ansible.cfg in AWX ====== For awx installs, you'll want to make sure you place the ansible.cfg on the awx_task container file system. docker exec -t -i awx_task /bin/bash vi /etc/ansible/ansible.cfg example disabling deprecation warnings set "deprecation_warnings = False" ====== router upgrade ====== https://github.com/lillianphyoe/csr1000v_upgrade/blob/master/ansible_awx/upgrade_actions.yml http://anastarsha.com/automating-cisco-device-upgrades-with-ansible/ https://gdykeman.github.io/2018/06/26/ios-upgrades/ https://www.ansible.com/blog/rebooting-network-devices-with-ansible https://www.jeffgeerling.com/blog/2018/reboot-and-wait-reboot-complete-ansible-playbook ====== awx esxi ====== https://graspingtech.com/ansible-esxi/ ====== encryption docker awx ====== https://lreed.net/post/2018-01-10-awx-nginx/ cd my_nginx_build/ nano Dockerfile nano nginx.conf aaopenssl genrsa -des3 -passout pass:x -out server.pass.key 2048 openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out MyCertificate.crt -keyout MyKey.key ls -la mv MyCertificate.crt mycert.crt mv MyKey.key mykey.key nano nginx.conf cat nginx.conf docker run -d --name my-nginx -p 980:80 -p 9443:8443 --link awx_web:awx_web --net awxcompose_default my-nginx