ansible.builtin.aix_inittab (v2.6.0) — module

Manages the inittab on AIX

| "added in version" 2.3 of ansible.builtin"

Authors: Joris Weijters (@molekuul)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.6.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
  aix_inittab:
    name: startmyservice
    runlevel: 4
    action: once
    command: echo hello
    insertafter: existingservice
    state: present
  become: yes
  • 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
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: present
  become: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove startmyservice from inittab
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: absent
  become: yes

Inputs

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

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

action:
    choices:
    - boot
    - bootwait
    - hold
    - initdefault
    - false
    - once
    - ondemand
    - powerfail
    - powerwait
    - respawn
    - sysinit
    - wait
    description:
    - Action what the init has to do with this entry.
    required: true

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

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

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

Outputs

changed:
  description: whether the inittab changed or not
  returned: always
  sample: true
  type: boolean
msg:
  description: action done with the inittab entry
  returned: changed
  sample: changed inittab entry startmyservice
  type: string
name:
  description: name of the adjusted inittab entry
  returned: always
  sample: startmyservice
  type: string