Skip to content

Commit

Permalink
Lint: intsallp, lpar, lppp, lvm facts,lvol, mkfilt, mktcpip, mktun
Browse files Browse the repository at this point in the history
Signed-off-by: Nitish K Mishra <[email protected]>
  • Loading branch information
nitismis committed Mar 30, 2024
1 parent 1f83fc3 commit 3d35fdf
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 160 deletions.
29 changes: 13 additions & 16 deletions playbooks/demo_installp.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
---
- name: "INSTALLP on AIX"
- name: INSTALLP on AIX
hosts: "{{host_name}}"
gather_facts: no
gather_facts: false
vars:
host_name: all
device_name: /dev/rmt0.1
collections:
- ibm.power_aix
tasks:

- name: List all software products and installable options contained on an installation cartridge tape
installp:
ibm.power_aix.installp:
action: list
device: "{{device_name}}"
device: "{{ device_name }}"
- name: List all customer-reported problems fixed by all software products on an installation tape
installp:
ibm.power_aix.installp:
action: list_fixes
device: "{{device_name}}"
device: "{{ device_name }}"
install_list: all
- name: Install all filesets within the bos.net software package and expand file systems if necessary
installp:
extend_fs: yes
ibm.power_aix.installp:
extend_fs: true
device: /usr/sys/inst.images
install_list: bos.net
- name: Reinstall and commit the NFS software product option that is already installed on the system at the same level
installp:
commit: yes
force: yes
device: "{{device_name}}"
ibm.power_aix.installp:
commit: true
force: true
device: "{{ device_name }}"
install_list: bos.net.nfs.client:4.1.0.0
- name: Remove a fileset named bos.net.tcp.server
installp:
ibm.power_aix.installp:
action: deinstall
install_list: bos.net.tcp.server
8 changes: 3 additions & 5 deletions playbooks/demo_lpar_facts.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
- name: "Print the LPAR related information"
hosts: "{{ hosts_val }}"
gather_facts: yes
gather_facts: true
vars:
hosts_val: all
log_file: "/tmp/ansible_lpar_debug.log"
collections:
- ibm.power_aix

tasks:
- name: "LPAR information"
lpar_facts:
ibm.power_aix.lpar_facts:
- name: Print the LPAR related information
debug:
ansible.builtin.debug:
var: ansible_facts.lpar
60 changes: 27 additions & 33 deletions playbooks/demo_lpp_facts.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,66 @@
---
- name: "Print the fileset related information"
- name: Print the fileset related information
hosts: "{{ hosts_val }}"
gather_facts: yes
gather_facts: true
vars:
hosts_val: all
log_file: "/tmp/ansible_lpp_debug.log"
collections:
- ibm.power_aix

log_file: /tmp/ansible_lpp_debug.log
tasks:
- name: "Gather the fileset facts"
- name: Gather the fileset facts
lpp_facts:

- name: Check whether a fileset called 'openssh.base.client' is installed
debug:
ansible.builtin.debug:
msg: Fileset 'openssh.base.client' is installed
when: "'openssh.base.client' in ansible_facts.filesets"

- name: Check whether a fileset called 'test.base.xyz' is installed
debug:
ansible.builtin.debug:
msg: Fileset 'test.base.xyz' is installed
when: "'test.base.xyz' in ansible_facts.filesets"

- name: "Gather the fileset facts"
lpp_facts:
- name: Gather the fileset facts
ibm.power_aix.lpp_facts:
filesets: openssh.base.client

- name: "Gather the fileset facts"
lpp_facts:
- name: Gather the fileset facts
ibm.power_aix.lpp_facts:
filesets: test.base.xyz

- name: Populate fileset facts with the installation state for the most recent
level of installed filesets for all of the bos.rte filesets
lpp_facts:
- name: Populate fileset facts with the installation state for the most recent level of installed filesets for all of the bos.rte filesets
ibm.power_aix.lpp_facts:
filesets: bos.rte.*

- name: Print the fileset facts
debug:
ansible.builtin.debug:
var: ansible_facts.filesets

- name: Populate fileset facts with the installation state for all the filesets
contained in the Server bundle
lpp_facts:
- name: Populate fileset facts with the installation state for all the filesets contained in the Server bundle
ibm.power_aix.lpp_facts:
bundle: Server

- name: Print the fileset facts
debug:
ansible.builtin.debug:
var: ansible_facts.filesets

- name: Print the filesets in a lists
set_fact:
ansible.builtin.set_fact:
fileset_list: "{{ ansible_facts.filesets.keys() | list }}"
- debug:
- ansible.builtin.debug:
var: fileset_list

- name: Populate fileset facts with the installation state for the most recent
level of installed filesets for all of the bos.rte filesets and also with
the requisites details
lpp_facts:
filesets: bos.rte.*
reqs: True
- name: Populate fileset facts with the installation state for the most recent level of installed filesets
for all of the bos.rte filesets and also with the requisites details
ibm.power_aix.lpp_facts:
filesets: bos.rte.*
reqs: true
- name: Print the fileset facts
debug:
var: ansible_facts.filesets
ansible.builtin.debug:
var: ansible_facts.filesets

- name: Populate fixes facts with the status of APAR fixes installed on the system
lpp_facts:
ibm.power_aix.lpp_facts:
fix_type: apar
- name: Print the fixes facts
debug:
ansible.builtin.debug:
var: ansible_facts.fixes
24 changes: 11 additions & 13 deletions playbooks/demo_lvm_facts.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
---
- name: "Print the LVM related information"
- name: Print the LVM related information
hosts: "{{ hosts_val }}"
gather_facts: yes
gather_facts: true
vars:
hosts_val: all
log_file: "/tmp/ansible_lvmfacts_debug.log"
collections:
- ibm.power_aix
log_file: /tmp/ansible_lvmfacts_debug.log

tasks:
- name: "Gather all lvm facts"
lvm_facts:
- name: "Gather VG facts"
lvm_facts:
- name: Gather all lvm facts
ibm.power_aix.lvm_facts:
- name: Gather VG facts
ibm.power_aix.lvm_facts:
name: all
component: vg
- name: "Gather LV facts"
lvm_facts:
- name: Gather LV facts
ibm.power_aix.lvm_facts:
name: all
component: lv
- name: "Update PV facts to existing LVM facts"
lvm_facts:
- name: Update PV facts to existing LVM facts
ibm.power_aix.lvm_facts:
name: all
component: pv
lvm: "{{ ansible_facts.LVM }}"
55 changes: 26 additions & 29 deletions playbooks/demo_lvol.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,54 @@
---
- name: "LVOL on AIX"
hosts: "{{host_name}}"
gather_facts: no
- name: LVOL on AIX
hosts: "{{ host_name }}"
gather_facts: false
vars:
host_name: all
vg_name: rootvg
lv_name: testlv
size_val: "64M"
increase_size_val:

collections:
ibm.power_aix
size_val: 64M
increase_size_val:
tasks:
- name: Create a logical volume of 64M
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
vg: "{{ vg_name }}"
lv: testrootlv
size: "{{size_val}}"
size: "{{ size_val }}"
- name: Create a logical volume of 10 logical partitions with disks hdisk0 and hdisk1
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
vg: "{{ vg_name }}"
lv: test2lv
size: "{{size_val}}"
size: "{{ size_val }}"
pv_list: hdisk0, hdisk1
- name: Create a logical volume of 32M with a minimum placement policy
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
vg: "{{ vg_name }}"
lv: test4lv
size: "32M"
size: 32M
policy: minimum
- name: Create a logical volume with extra options like mirror pool
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
lv: "{{lv_name}}"
size: "{{size_val}}"
vg: "{{ vg_name }}"
lv: "{{ lv_name }}"
size: "{{ size_val }}"
extra_opts: -m copy1=poolA -m copy2=poolB
- name: Extend a logical volume by 1G
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
lv: "{{lv_name}}"
size: "+1G"
vg: "{{ vg_name }}"
lv: "{{ lv_name }}"
size: +1G
- name: Rename a logical volume
lvol:
ibm.power_aix.lvol:
state: present
vg: "{{vg_name}}"
lv: "{{lv_name}}"
vg: "{{ vg_name }}"
lv: "{{ lv_name }}"
lv_new_name: renamedlv
- name: Remove the logical volume
lvol:
ibm.power_aix.lvol:
state: absent
lv: testrootlv
52 changes: 25 additions & 27 deletions playbooks/demo_mkfilt.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
---
- name: "MKFILT on AIX"
- name: MKFILT on AIX
hosts: "{{host_name}}"
gather_facts: no
gather_facts: false
vars:
host_name: all
interface_v: en0
import_directory: /root
export_directory: /root
collections:
ibm.power_aix
tasks:
- name: Allow SSH activity through interface
mkfilt:
ibm.power_aix.mkfilt:
ipv4:
log: yes
log: true
default: deny
rules:
- action: permit
direction: inbound
d_opr: eq
d_port: 22
interface: "{{interface_v}}"
description: permit SSH requests from any clients
- action: permit
direction: outbound
s_opr: eq
s_port: 22
interface: "{{interface_v}}"
description: permit SSH answers to any clients
- action: permit
direction: inbound
d_opr: eq
d_port: 22
interface: "{{ interface_v }}"
description: permit SSH requests from any clients
- action: permit
direction: outbound
s_opr: eq
s_port: 22
interface: "{{ interface_v }}"
description: permit SSH answers to any clients
- name: Remove all user-defined and auto-generated filter rules
mkfilt:
ibm.power_aix.mkfilt:
ipv4:
default: permit
force: yes
force: true
rules:
- action: remove
id: all
- action: remove
id: all
- name: Export filter rules as is into export text files
mkfilt:
ibm.power_aix.mkfilt:
action: export
directory: "{{export_directory}}"
rawexport: yes
directory: "{{ export_directory }}"
rawexport: true
- name: Import Filter rules
mkfilt:
ibm.power_aix.mkfilt:
action: import
directory: "{{import_directory}}"
directory: "{{ import_directory }}"
20 changes: 9 additions & 11 deletions playbooks/demo_mktcpip.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
- name: "MKTCPIP on AIX"
hosts: "{{host_name}}"
gather_facts: no
- name: MKTCPIP on AIX
hosts: "{{ host_name }}"
gather_facts: false
vars:
host_name: all
address_v: 192.9.200.4
nameserver_v: 192.9.200.1
interface_v: en0
domain_v: austin.century.com
collections:
ibm.power_aix
tasks:
- name: Set the required values for starting TCP/IP
mktcpip:
ibm.power_aix.mktcpip:
hostname: fred.austin.century.com
address: "{{address_v}}"
interface: "{{interface_v}}"
nameserver: "{{nameserver_v}}"
domain: "{{domain_v}}"
start_daemons: yes
address: "{{ address_v }}"
interface: "{{ interface_v }}"
nameserver: "{{ nameserver_v }}"
domain: "{{ domain_v }}"
start_daemons: true
Loading

0 comments on commit 3d35fdf

Please sign in to comment.