ansiblemod-sslcentos8

Ansible-Playbook for the Install of mod_ssl, python-passlib and firewalld (and keep them always latest)


I manage 2 Clients (centos8) with Ansible, and i want to install mod-ssl on the webserver, python-passlib on all hosts and firewalld on all hosts. The Playbook should check every time it runs, wheter the 3 packages are the latest available.

I´ve already wrote a playbook, but i get the errormessage, that there is no package with the name "python-passlib"

Is there another name for this package on centos8? And i think my way to install this mod-ssl package is false as well... Could you guys check my Playbook and give me a hint ? :D

Here´s my playbook:


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

Thank you guys in advance!! Greetings Mike


Solution

    1. python-passlib

    python3-passlib is the package name for CentOS 8 (RHEL 8 and its derivatives). It is also available for RHEL 9 and its derivatives.

    python-passlib was deprecated in later versions of RHEL 7 and removed completely in RHEL 8 / CentOS 8.

    In case you still need to use this package with Python 2 in CentOS 8/RHEL 8 you can use the Ansible pip module and install passlib. You could also source a 3rd-party packaged RPM of passlib, but I would recommend against this unless you trust the source.

    1. mod_ssl

    mod_ssl can be installed from the RPM repositories, you just need to adjust the package name in your task (you have mod-ssl, but it should be mod_ssl). You will also need to add state: latest if you want it to keep the package up to date:

      - name: Install mod-ssl and keep it up-to-date
        dnf:
          name: mod_ssl
        state: latest