
- name: webmin sys265
  hosts: webmin
  become: true
  vars:
    install_utilities: false
    firewalld_enable: true

  pre_tasks:
    - name: add webmin repo and GPG key
      yum_repository:
        name: webmin
        description: Webmin Distribution Neutral
        baseurl: http://download.webmin.com/download/yum
        enabled: true
        gpgcheck: true
        gpgkey: http://www.webmin.com/jcameron-key.asc

    - name: clean and update YUM cache
      yum:
        update_cache: yes

  roles:
  - semuadmin.webmin

  handlers:
  - name: reload firewall
    command: firewall-cmd --reload

  tasks:
  - name: add firewall rule
    firewalld:
      port: 10000/tcp
      permanent: true
      state: enabled
    notify: reload firewall

  - name: install webmin
    yum:
      name: webmin
      state: present

  - name: enable and start webmin service
    systemd:
      name: webmin
      enabled: true
      state: started
      daemon_reload: yes

