ansible-aix / ansible-power-aix

Developer contributions for Ansible Automation on Power
GNU General Public License v3.0
3 stars 1 forks source link

New inetd role #67

Open robinvy opened 4 years ago

robinvy commented 4 years ago

Can we modify this configuration file?

dberg1 commented 4 years ago

I could not find any existing inetd module for Ansible. If it is just a matter of modifying /etc/inetd.conf, one could use replace module to change the lines in the file.

dberg1 commented 4 years ago

Here is an example showing how to disable telnet and ftpd on an AIX system using Ansible replace and service core modules.

- hosts: aix
  gather_facts: no

  handlers:
  - name: restart inetd
    service: name=inetd state=restarted
  tasks:
  - name: disable ftpd and telnet
    replace:
      path: /etc/inetd.conf
      regexp: '^(ftp\s|telnet\s)'
      replace: '#\1'
      backup: yes
      owner: root
      group: system
      mode: 0664
    notify: restart inetd
robinvy commented 4 years ago

May be good to create a role to ease typical actions.