Search code examples
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

  • python-passlib was deprecated in later versions of RHEL 7 and removed completely in RHEL 8 (hence also removed in CentOS 8). It might become available in the EPEL repository, however it is not currently there. There is an open RFE for its inclusion here

    To install python-passlib in the meantime, you can use the Ansible pip module and install passlib. You could source a 3rd-party packaged RPM of passlib, but I would recommend against this unless you trust the source.

    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