Linux离线装置Awx
可自行去下载相干包,也能够给我评论留言,我发给大家
wget https://github.com/ansible/awx/archive/1.0.7.tar.gz 失败https://github.com/ansible/awx/archive/11.0.0.tar.gz 在虚拟机上胜利启动wget https://github.com/ansible/awx/archive/13.0.0.tar.gz 须要python3tar -zxvf 11.0.0.tar.gz cd awx-11.0.0/installer/ ansible-playbook -i inventory install.yml留神: 有可能端口占用了docker stop awx_task awx_web awx_postgres awx_redis awx_memcached docker stop memcached rabbitmq postgresdocker rm awx_task awx_web awx_postgres awx_redis awx_memcached docker rm memcached rabbitmq postgres离线装置下载pip download docker -d /data/docker装置pip install --ignore-installed requests --no-index --find-links=file:/data/docker dockerpip download docker-compose -d /data/docker_compose pip install --no-index --find-links=file:/data/docker_compose docker_compose在线装置pip install dockerpip install docker-composepip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com docker-compose==1.16.0pip3 install requestspip3 install dockerpip3 install docker-composedocker exec -it awx_task /bin/bashcd /var/lib/awx/projects/ansible-for-devops/cat main.yml ---- name: test date cmd hosts: all connection: local tasks: - name: Check the ping on the server. command: datecat uploadfile.yml- name: file upload hosts: all connection: paramiko tasks: - name: 创立目录 shell: mkdir -p /data/iot - name: upload file. copy: src={{path}} dest=/data/iot 导入清单docker exec -it awx_task /bin/bashawx-manage inventory_import --source=/etc/ansible/hosts --group-filter=iot-test --inventory-name=iot --keep-vars--source 指定inventory文件--group-filter 从文件中通过组名过滤--host-filter 通过host name过滤--inventory-name 导入到指定名称资产清单--inventory-id 导入到指定ID的资产清单# name 和 id 选一个--overwrite 笼罩主机和组,默认不笼罩--overwrite-vars 笼罩主机变量--keep-vars 放弃主机变量--enabled-value 导入的主机状态是否激活默认激活cat hosts [iotdb-host]# 在[]中的,为一组,iot-test为组名,前面会用到#139.9.130.81 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=abcd_2020114.116.194.17 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=abcd_2019192.168.140.102 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=abcd123tower-manage inventory_import --source=/data/hosts --group-filter=iotdb-host --inventory-name=iotdb --keep-vars