community.general.aix_inittab – Manages the inittab on AIX
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.aix_inittab
.
Parameters
Parameter |
Comments |
---|---|
Action what the init has to do with this entry. Choices:
|
|
What command has to run. |
|
After which inittabline should the new entry inserted. |
|
Name of the inittab entry. |
|
Runlevel of the entry. |
|
Whether the entry should be present or absent in the inittab file. Choices:
|
Notes
Note
The changes are persistent across reboots.
You need root rights to read or adjust the inittab with the
lsitab
,chitab
,mkitab
orrmitab
commands.Tested on AIX 7.1.
Examples
# Add service startmyservice to the inittab, directly after service existingservice.
- name: Add startmyservice to inittab
community.general.aix_inittab:
name: startmyservice
runlevel: 4
action: once
command: echo hello
insertafter: existingservice
state: present
become: yes
# Change inittab entry startmyservice to runlevel "2" and processaction "wait".
- name: Change startmyservice to inittab
community.general.aix_inittab:
name: startmyservice
runlevel: 2
action: wait
command: echo hello
state: present
become: yes
- name: Remove startmyservice from inittab
community.general.aix_inittab:
name: startmyservice
runlevel: 2
action: wait
command: echo hello
state: absent
become: yes
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Whether the inittab changed or not Returned: always Sample: true |
|
Action done with the inittab entry Returned: changed Sample: “changed inittab entry startmyservice” |
|
Name of the adjusted inittab entry Returned: always Sample: “startmyservice” |
Authors
Joris Weijters (@molekuul)