Open robinvy opened 4 years ago
I could not find any existing bootp module for Ansible.
Here is an example showing how to add an entry to /etc/bootptab and how to enable bootp server and restart inetd.
The example uses lineinfile
, replace
and service
Ansible core modules.
- hosts: aix
gather_facts: no
handlers:
- name: restart inetd
service: name=inetd state=restarted
tasks:
- name: add booptab entry
lineinfile:
path: /etc/bootptab
regexp: '^myclient:'
line: 'myclient:bf=/var/lib/tftpboot/core.elf:ip=10.0.0.2:sa=10.0.0.10:ht=ethernet:gw=10.0.0.1:sm=255.0.0.0:'
- name: enable bootp server
replace:
path: /etc/inetd.conf
regexp: '^#(bootps\s)'
replace: '\1'
backup: yes
owner: root
group: system
mode: 0664
notify: restart inetd
Please create a role for this kind of activities.
Can we modify this configuration file?