Linux离线安装Awx

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 需要python3

tar -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 postgres

docker 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 docker

pip download docker-compose -d /data/docker_compose 
pip install --no-index --find-links=file:/data/docker_compose docker_compose

在线安装
pip install docker
pip install docker-compose
pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com docker-compose==1.16.0


pip3 install requests
pip3 install docker
pip3 install docker-compose

docker exec -it awx_task /bin/bash
cd /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: date



cat 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/bash
awx-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_2020
114.116.194.17 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=abcd_2019
192.168.140.102 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=abcd123

tower-manage inventory_import --source=/data/hosts --group-filter=iotdb-host --inventory-name=iotdb --keep-vars

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

beyond阿亮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值