一、软件环境

  • CentOS 7.9(最小化安装)
  • Ansible 2.9.25
  • Ansible-tower 3.8.3

二、安装

1、离线安装Ansible

先使用一台可以联网的虚拟机,下载所有需要的依赖包

# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm# yum install ansible --downloadonly --downloaddir=./

然后,将所有rpm包上传到没有网络的离线服务器(模拟生产环境的内网服务器),然后一条命令即可完成安装操作。

检查ansible的版本信息

# ansible --version
ansible 2.9.25config file = /etc/ansible/ansible.cfgconfigured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']ansible python module location = /usr/lib/python2.7/site-packages/ansibleexecutable location = /usr/bin/ansiblepython version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

2、安装Ansible-tower

从下面的页面下载3.8.3版本的Ansible-tower

https://releases.ansible.com/ansible-tower/setup-bundle/

上传到服务器,解压,修改安装目录下的inventory文件,设置相关的密码字段。

创建日志目录,这一步不执行,会导致安装过程报错中断

# mkdir -p /var/log/tower

执行./setup.sh即可开始安装。

【勘误-20211123】

如果虚拟机完全断网,下面的安装会报错中断。经过测试发现,Ansible-tower在安装过程中还需要安装特定的组件(如:rh-postgres10-postgres、rh-redis5等),以及300多个依赖包。

Ansible-tower服务管理的基本命令:

ansible-tower-service start|stop|restart|status

# ansible-tower-service status
● ansible-tower.service - Ansible Tower serviceLoaded: loaded (/usr/lib/systemd/system/ansible-tower.service; enabled; vendor preset: disabled)Active: active (exited) since 五 2021-10-22 12:04:30 CST; 40s agoProcess: 8375 ExecStart=/bin/true (code=exited, status=0/SUCCESS)Main PID: 8375 (code=exited, status=0/SUCCESS)10月 22 12:04:30 ansible-tower systemd[1]: Starting Ansible Tower service...
10月 22 12:04:30 ansible-tower systemd[1]: Started Ansible Tower service.● rh-postgresql10-postgresql.service - PostgreSQL database serverLoaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; enabled; vendor preset: disabled)Drop-In: /etc/systemd/system/rh-postgresql10-postgresql.service.d└─override.confActive: active (running) since 五 2021-10-22 11:53:36 CST; 11min agoMain PID: 3961 (postmaster)Tasks: 16Memory: 13.2MCGroup: /system.slice/rh-postgresql10-postgresql.service├─3961 /opt/rh/rh-postgresql10/root/usr/bin/postmaster -D /var/opt/rh/rh-postgresql10/lib/pgsql/data├─3963 postgres: logger process   ├─3965 postgres: checkpointer process   ├─3966 postgres: writer process   ├─3967 postgres: wal writer process   ├─3968 postgres: autovacuum launcher process   ├─3969 postgres: stats collector process   ├─3970 postgres: bgworker: logical replication launcher   ├─8423 postgres: awx awx 127.0.0.1(56384) idle├─8443 postgres: awx awx 127.0.0.1(56390) idle├─8444 postgres: awx awx 127.0.0.1(56392) idle├─8445 postgres: awx awx 127.0.0.1(56394) idle├─8465 postgres: awx awx 127.0.0.1(56410) idle├─8466 postgres: awx awx 127.0.0.1(56412) idle├─8467 postgres: awx awx 127.0.0.1(56414) idle└─8476 postgres: awx awx 127.0.0.1(56422) idle10月 22 11:53:36 ansible-tower systemd[1]: Stopped PostgreSQL database server.
10月 22 11:53:36 ansible-tower systemd[1]: Starting PostgreSQL database server...
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.683 UTC  >日志:  listening on IPv4 address "0.0.0.0", port 5432
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.683 UTC  >日志:  listening on IPv6 address "::", port 5432
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.685 UTC  >日志:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.686 UTC  >日志:  listening on Unix socket "/tmp/.s.PGSQL.5432"
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.704 UTC  >日志:  日志输出重定向到日志收集进程
10月 22 11:53:36 ansible-tower postmaster[3961]: < 2021-10-22 03:53:36.704 UTC  >提示:  后续的日志输出将出现在目录 "pg_log"中.
10月 22 11:53:36 ansible-tower systemd[1]: Started PostgreSQL database server.● rh-redis5-redis.service - Redis persistent key-value databaseLoaded: loaded (/usr/lib/systemd/system/rh-redis5-redis.service; enabled; vendor preset: disabled)Drop-In: /etc/systemd/system/rh-redis5-redis.service.d└─limit.conf, override.confActive: active (running) since 五 2021-10-22 11:59:55 CST; 5min agoMain PID: 5771 (redis-server)Tasks: 4Memory: 4.1MCGroup: /system.slice/rh-redis5-redis.service└─5771 /opt/rh/rh-redis5/root/usr/bin/redis-server 127.0.0.1:010月 22 11:59:55 ansible-tower systemd[1]: Starting Redis persistent key-value database...
10月 22 11:59:55 ansible-tower systemd[1]: Started Redis persistent key-value database.● nginx.service - The nginx HTTP and reverse proxy serverLoaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)Drop-In: /etc/systemd/system/nginx.service.d└─override.confActive: active (running) since 五 2021-10-22 12:04:29 CST; 40s agoProcess: 8345 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)Process: 8342 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)Process: 8340 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)Main PID: 8347 (nginx)Tasks: 3Memory: 2.4MCGroup: /system.slice/nginx.service├─8347 nginx: master process /usr/sbin/nginx├─8348 nginx: worker process└─8349 nginx: worker process10月 22 12:04:29 ansible-tower systemd[1]: Stopped The nginx HTTP and reverse proxy server.
10月 22 12:04:29 ansible-tower systemd[1]: Starting The nginx HTTP and reverse proxy server...
10月 22 12:04:29 ansible-tower nginx[8342]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
10月 22 12:04:29 ansible-tower nginx[8342]: nginx: configuration file /etc/nginx/nginx.conf test is successful
10月 22 12:04:29 ansible-tower systemd[1]: Started The nginx HTTP and reverse proxy server.● supervisord.service - Process Monitoring and Control DaemonLoaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled)Drop-In: /etc/systemd/system/supervisord.service.d└─override.confActive: active (running) since 五 2021-10-22 12:04:29 CST; 41s agoProcess: 8308 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)Main PID: 8311 (supervisord)Tasks: 32Memory: 656.3MCGroup: /system.slice/supervisord.service├─8311 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf├─8382 python3 /usr/bin/failure-event-handler├─8384 scl enable rh-postgresql10 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --ma...├─8385 python3 /usr/bin/awx-manage run_wsbroadcast├─8386 python3 /var/lib/awx/venv/awx/bin/daphne -u /var/run/tower/daphne.sock awx.asgi:channel_layer├─8387 python3 /usr/bin/awx-manage run_callback_receiver├─8388 python3 /usr/bin/awx-manage run_dispatcher├─8393 /bin/bash /var/tmp/sclqIhqx8├─8402 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --master --no-orphans --buffer-...├─8429 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --master --no-orphans --buffer-...├─8430 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --master --no-orphans --buffer-...├─8431 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --master --no-orphans --buffer-...├─8432 /var/lib/awx/venv/awx/bin/uwsgi --socket /var/run/tower/uwsgi.sock --module=awx.wsgi:application --stats /var/lib/awx/uwsgi.stats --chmod-socket=660 --vacuum --master --no-orphans --buffer-...├─8437 python3 /usr/bin/awx-manage run_dispatcher├─8439 python3 /usr/bin/awx-manage run_dispatcher├─8440 python3 /usr/bin/awx-manage run_dispatcher├─8441 python3 /usr/bin/awx-manage run_dispatcher├─8442 python3 /usr/bin/awx-manage run_dispatcher├─8446 python3 /usr/bin/awx-manage run_callback_receiver├─8447 python3 /usr/bin/awx-manage run_callback_receiver├─8448 python3 /usr/bin/awx-manage run_callback_receiver├─8449 python3 /usr/bin/awx-manage run_callback_receiver└─8456 rsyslogd -n -i /var/run/awx-rsyslog/rsyslog.pid -f /var/lib/awx/rsyslog/rsyslog.conf10月 22 12:04:29 ansible-tower systemd[1]: Starting Process Monitoring and Control Daemon...
10月 22 12:04:29 ansible-tower systemd[1]: Started Process Monitoring and Control Daemon.
10月 22 12:04:30 ansible-tower rsyslogd[8383]: [origin software="rsyslogd" swVersion="8.1911.0-8.el7at" x-pid="8383" x-info="https://www.rsyslog.com"] start
10月 22 12:04:35 ansible-tower rsyslogd[8383]: [origin software="rsyslogd" swVersion="8.1911.0-8.el7at" x-pid="8383" x-info="https://www.rsyslog.com"] exiting on signal 15.
10月 22 12:04:35 ansible-tower rsyslogd[8456]: [origin software="rsyslogd" swVersion="8.1911.0-8.el7at" x-pid="8456" x-info="https://www.rsyslog.com"] start

至此,Ansible-tower即安装完成。可以使用https协议,以及服务器的IP地址登录,默认使用443端口。

【Ansible】非完全离线安装Ansible和Ansible-tower相关推荐

  1. 使用ansible离线安装rpm包

    首先利用copy模块将包分发至目标机器 命令方式 ansible cloud -m copy -a "src=telnet-0.17-66.el7.x86_64.rpm dest=/tmp/ ...

  2. 通过ansible剧本自动化离线部署Elasticsearch

    1.部署环境介绍 软件名称 版本 elasticsearch 7.6.2 jdk 1.8.0 Centos7.6 CentOS-7-x86_64-Everything-1810 2.基线加固功能介绍 ...

  3. ansible的介绍与安装

    Ansible的介绍与安装 文章目录 Ansible的介绍与安装 一.什么是ansible 二.ansible优点 三.ansible管理方式 四.ansible系统架构 五.ansible任务执行模 ...

  4. Ubuntu20.04安装nVidia驱动ansible剧本

    Ubuntu20.04安装nVidia驱动ansible剧本 Ubuntu20.04安装nVidia驱动ansible剧本 Ubuntu20.04安装nVidia驱动ansible剧本 --- #获取 ...

  5. centos7离线安装ansible

    centos7离线安装ansible: 1.通过在线的centos7将rpm包下载好了,上传到指定服务器. 下载官方repo,rpm -iUvh http://dl.Fedoraproject.org ...

  6. ansible离线安装

    生产环境中经常限制外网的权限,所以安装软件经常会遇到问题.如果有自己的yum服务器还好,如果没有就很麻烦. 目前ansible安装的时候用yum的比较多,但是不能连接外网是没办法安装的.这里介绍一种离 ...

  7. Ansible一键离线安装部署

    一.Ansible简介 Ansible 是一个开源的基于 OpenSSH 的自动化配置管理工具.可以用它来配置系统.部署软件和编排更高级的 IT 任务,比如持续部署或零停机更新.Ansible 的主要 ...

  8. Linux虚拟机上离线安装ansible awx_亲测成功

    Linux虚拟机上离线安装ansible awx_亲测成功 可自行去下载相关包,也可以给我评论留言,我发给大家 ansible awx离线安装----虚拟机上安装 成功---------------- ...

  9. Linux离线安装Ansible

    Linux离线安装Ansible 可自行去下载相关包,也可以给我评论留言,我发给大家 python -Vtar -zxvf setuptools-7.0.tar.gz cd setuptools-7. ...

  10. Ansible简单介绍及安装部署详解

    ansible简单介绍 ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef.func.fabric)的优点,实现了批量系统配置. ...

最新文章

  1. R语言ggplot2可视化强制设置x轴、y轴坐标的起始点为0或者其他实战
  2. oracle10 exp imp 中文乱码
  3. Android以当前Activity为基准进行截屏
  4. Redis-过期Key删除/淘汰Kry策略
  5. Eclipse 创建 Maven 工程
  6. leetcode691:Stickers to Spell Word
  7. Java引用类型分析
  8. pythonmkdir语法错误_Python mkdir一个有难度的问题
  9. 海量数据挖掘MMDS week5: 聚类clustering
  10. office2016显示已经激活,但每次打开都跳出激活页面
  11. Zoreto+坚果云+pdf expert(papership) 实现文献管理和批注同步
  12. 0基础运营小白如何写出10W+,六招搞定!
  13. pubwin修改服务器时间,如何解决控制台打开(Pubwin)提示服务器没有启动或者服务器IP地址改变问题...
  14. 基于VHDL的密码锁
  15. nvme分区选mbr还是guid_硬盘分区不求人:秒懂MBR和GPT分区表
  16. 人工智能是引领未来的战略性技术 推动人工智能多学科交叉融合
  17. 六维空间:更快、更新、更优秀的教育网IPV6免费资源共享平台!
  18. 我的物联网开发入门和踩坑历程
  19. 为什么SDWAN成为了组网发展大趋势呢?
  20. 怎么对本地局域网计算机控制,如何远程控制他人电脑 局域网与互联网控制电脑的方法【详细介绍】...

热门文章

  1. VS配置arduino环境
  2. 文字转语音真人发声免费的有哪些?文字转语音有这两款软件就够了
  3. 【免费】文字转换语音合成软件地摊叫卖录音真人配音广告制作朗读播音软件
  4. vue直播rtmp流
  5. 单片机蓝牙模块与手机蓝牙通信(3)
  6. cmpp具体java实例_cmpp3.0_JAVA_实现 - 源码下载|Windows编程|源代码 - 源码中国
  7. plc和c语言和cnc,cnc数控编程和plc编程哪个难学
  8. itools苹果录屏大师_录屏可以有声音,发照片可以免流量,计算器输错可回删
  9. 易语言注册机:界面绘制及皮肤模块的引用
  10. 驱动人生:英伟达显卡驱动471.11官方版Win10+Win7最新下载地址