我用 Ansible 管理 2 个客户端(centos8),我想在网络服务器上安装 mod-ssl,在所有主机上安装 python-passlib,在所有主机上安装 firewalld。Playbook 应该在每次运行时检查 3 个包是否是最新可用的。
我已经写了一本剧本,但我收到错误消息,没有名为“python-passlib”的包
这个包在centos8上还有别的名字吗?而且我认为我安装这个 mod-ssl 包的方式也是错误的......你们能检查我的剧本并给我一个提示吗?:D
这是我的剧本:
- hosts: all
become: yes
tasks:
- name: Install different services and keep them up-to-date
dnf:
name:
- firewalld
- python-passlib
state: latest
- hosts: webserver
become: yes
tasks:
- name: Install mod-ssl and keep it up-to-date
dnf:
name: mod-ssl
- hosts: webserver
become: yes
tasks:
- name: Insert a index.php site
copy:
src: /home/mike/devops_live_demo/index.php
dest: /var/www/html/
owner: mike
mode: '0644'
- hosts: webserver
become: yes
tasks:
- name: Reboot the Webserver
reboot:
提前谢谢各位!!问候迈克