User Tools

Site Tools


burim:awx

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://<tower-host>/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/<your job template id>/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

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

backup awx

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

awx 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
burim/awx.txt · Last modified: 2021/11/30 10:26 by burim

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki