community.general.aix_inittab (8.5.0) — module

Manages the inittab on AIX

Authors: Joris Weijters (@molekuul)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manages the inittab on AIX.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove startmyservice from inittab
  community.general.aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: absent
  become: true

Inputs

    
name:
    aliases:
    - service
    description:
    - Name of the inittab entry.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the entry should be present or absent in the inittab file.
    type: str

action:
    choices:
    - boot
    - bootwait
    - hold
    - initdefault
    - 'off'
    - once
    - ondemand
    - powerfail
    - powerwait
    - respawn
    - sysinit
    - wait
    description:
    - Action what the init has to do with this entry.
    type: str

command:
    description:
    - What command has to run.
    required: true
    type: str

runlevel:
    description:
    - Runlevel of the entry.
    required: true
    type: str

insertafter:
    description:
    - After which inittabline should the new entry inserted.
    type: str

Outputs

changed:
  description: Whether the inittab changed or not
  returned: always
  sample: true
  type: bool
msg:
  description: Action done with the inittab entry
  returned: changed
  sample: changed inittab entry startmyservice
  type: str
name:
  description: Name of the adjusted inittab entry
  returned: always
  sample: startmyservice
  type: str