Skip to content

Commit

Permalink
Fixed linting issues (#556)
Browse files Browse the repository at this point in the history
* Fixed linting issues

Signed-off-by: schamola <[email protected]>

* linting issue

Signed-off-by: schamola <[email protected]>

---------

Signed-off-by: schamola <[email protected]>
  • Loading branch information
schamola authored Jul 17, 2024
1 parent 9bce4ad commit 884f012
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 72 deletions.
12 changes: 6 additions & 6 deletions playbooks/demo_chsec.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: CHSEC on AIX
hosts: "{{host_name}}"
gather_facts: False
gather_facts: false
vars:
host_name: all
tasks:
tasks:
- name: Add registry as files for a user
ibm.power_aix.chsec:
file: /etc/security/user
Expand All @@ -31,9 +31,9 @@
path: /etc/security/user
stanza: "{{ item }}"
attrs:
account_locked: True
login: False
rlogin: False
account_locked: true
login: false
rlogin: false
state: present
loop:
- "adm"
Expand All @@ -55,7 +55,7 @@
file: /etc/security/user
stanza: joe
attrs:
su: False
su: false
state: present
- name: Set password rules for a user
ibm.power_aix.chsec:
Expand Down
30 changes: 15 additions & 15 deletions playbooks/demo_flrtvc_local_patch_server.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
#[email protected]
#Demo playbook
#Create a local nginx with the patches
#Download patches with playbook:
#demo_shell_flrtvc_wget_ifix.yml
# [email protected]
# Demo playbook
# Create a local nginx with the patches
# Download patches with playbook:
# demo_shell_flrtvc_wget_ifix.yml
- name: "Demo install ifix from flrtvc from local patch server"
hosts: all
gather_facts: no
gather_facts: false
vars:
localpatchserver: "192.168.1.1"
localpatchpath: "ifix"
Expand All @@ -15,20 +15,20 @@
flrtvczip: "{{protocol}}://{{localpatchserver}}/{{localpatchpath}}/FLRTVC-latest.zip"
apar_csv_url: "{{protocol}}://{{localpatchserver}}/{{localpatchpath}}/apar.csv"
debug: false
collections:
- ibm.power_aix
tasks:
- name: Download apar.csv to {{ apar_csv }} from {{ apar_csv_url }}
ansible.builtin.shell:
cmd: "wget -q --no-check-certificate {{ apar_csv_url }} -O {{ apar_csv }}"
- name: Download apar.csv to /tmp/apar.csv from {{ apar_csv_url }}
ansible.builtin.get_url:
url: "{{ apar_csv_url }}"
dest: "{{ apar_csv }}"
validate_certs: false

- name: install all security interim fixes
- name: Install all security interim fixes
ibm.power_aix.flrtvc:
apar: "sec"
verbose: true
protocol: "{{ protocol }}"
force: no
clean: no
force: false
clean: false
flrtvczip: "{{ flrtvczip }}"
localpatchserver: "{{ localpatchserver }}"
localpatchpath: "{{ localpatchpath }}"
Expand All @@ -39,7 +39,7 @@
https_proxy: ""
PATH: "/usr/bin:/usr/sbin:/usr/local/bin:/opt/freeware/bin"

- name: debug reg_install
- name: Debug reg_install
ansible.builtin.debug:
var: reg_install
when: debug
6 changes: 3 additions & 3 deletions playbooks/demo_hdcrypt_pks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
device: "{{ lv_val }}"
location: "{{ loc }}"
passphrase: "{{ pass_val }}"
no_log: True
no_log: true

- name: "Import PKS key"
ibm.power_aix.hdcrypt_pks:
action: import
device: "{{ lv_val }}"
location: "{{ loc }}"
passphrase: "{{ pass_val }}"
no_log: True
no_log: true

- name: "Clean invalid PKS key"
ibm.power_aix.hdcrypt_pks:
action: clean
pks_label: "{{ key_label }}"
pks_label: "{{ key_label }}"
4 changes: 2 additions & 2 deletions playbooks/demo_install_all_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
device: "{{ device_val }}"
update_rpm: true

- name: install the latest level of install utilities on device /dev/cd0 (bos.rte.install update)
- name: Install the latest level of install utilities on device /dev/cd0 (bos.rte.install update)
ibm.power_aix.install_all_updates:
device: "{{ device_val }}"
utilities_only: true
utilities_only: true
27 changes: 14 additions & 13 deletions playbooks/demo_lku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@
gather_facts: false
vars:
host_name: all
PVC_name: powervchostname
PVC_password: passw0rd123
PVC_user: powervcuser
pvc_name: powervchostname
pvc_password: passw0rd123
pvc_user: powervcuser
directory: /tmp
filesets_fixes: bos.mp64 bos.rte.libc IZ12345.140806.epkg.Z

tasks:
- name: To install the updates to two filesets and to install an interim fix
ibm.power_aix.lku:
PVC_name: "{{ PVC_name }}"
PVC_password: "{{ PVC_password }}"
PVC_user: "{{ PVC_user }}"
PVC_name: "{{ pvc_name }}"
PVC_password: "{{ pvc_password }}"
PVC_user: "{{ pvc_user }}"
directory: "{{ directory }}"
filesets_fixes: "{{ filesets_fixes }}"

- name: To install all the updates and interim fixes that are available in the /tmp directory
ibm.power_aix.lku:
PVC_name: "{{ PVC_name }}"
PVC_password: "{{ PVC_password }}"
PVC_user: "{{ PVC_user }}"
PVC_name: "{{ pvc_name }}"
PVC_password: "{{ pvc_password }}"
PVC_user: "{{ pvc_user }}"
directory: "{{ directory }}"
filesets_fixes: all

- name: To install all the updates, but not interim fixes, that are located in the /tmp directory
ibm.power_aix.lku:
PVC_name: "{{ PVC_name }}"
PVC_password: "{{ PVC_password }}"
PVC_user: "{{ PVC_user }}"
PVC_name: "{{ pvc_name }}"
PVC_password: "{{ pvc_password }}"
PVC_user: "{{ pvc_user }}"
directory: "{{ directory }}"
filesets_fixes: update_all
filesets_fixes: update_all

2 changes: 1 addition & 1 deletion playbooks/demo_mpio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
- name: Gather mpio information when device and parent is provided
ibm.power_aix.mpio:
device: hdisk1
parent: vscsi0
parent: vscsi0
21 changes: 10 additions & 11 deletions playbooks/demo_password_rules_policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@
stanza: "{{ stanza_val }}"
registry: files
state: present
ignore_errors: true

- name: Change login times for user
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
logintimes: :0800-1700
state: present
ignore_errors: true

- name: Remove registry attribute from stanza
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
registry: files
state: absent
ignore_errors: true

- name: Lock System User Accounts
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
account_locked: "true"
login: "false"
rlogin: "false"
state: present
ignore_errors: true

- name: Allow other users to switch to this user using su command
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
su: true
state: present
ignore_errors: true

- name: Set password rules for a user
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
Expand All @@ -46,20 +46,19 @@
maxrepeats: 4
minlen: 8
state: present
ignore_errors: true

- name: Make the user admin
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
admin: true
ignore_errors: true

- name: Remove admin rights from the user
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
admin: false
ignore_errors: true

- name: Set core compress and core path to On
ibm.power_aix.password_rules_policies:
stanza: "{{ stanza_val }}"
core_compress: on
core_path: on
ignore_errors: true
core_compress: "on"
core_path: "on"
33 changes: 18 additions & 15 deletions playbooks/demo_shell_flrtvc_wget_ifix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Or create your own nginx server with a similar setup
- name: "AIX sync all ifixes on webserver"
hosts: aap-server
gather_facts: no
gather_facts: false
vars:
ifix_path: "/var/lib/awx/ifix/"
ifix_url: "https://aix.software.ibm.com/aix/ifixes/security/"
Expand All @@ -21,56 +21,59 @@
sync_apar: true
sync_flrtvc: true
tasks:
- name: "Create ifix_path {{ ifix_path }} if not exists"
- name: "Create ifix_path /var/lib/awx/ifix/ if not exists"
ansible.builtin.file:
path: "{{ ifix_path }}"
state: directory
mode: '0755'

- name: "Synchronizing ifix to {{ ifix_path }} from {{ ifix_url }} "
ansible.builtin.shell:
- name: "Synchronizing ifix to /var/lib/awx/ifix/ from {{ ifix_url }} "
ansible.builtin.command:
cmd: "{{ proxy }} wget -q -nc -r -np -nd --no-check-certificate -l 1 -A .tar,.asc,.sig {{ ifix_url }} "
chdir: "{{ ifix_path }}"
changed_when: true
register: ifixd
when: sync_ifix

- name: print ifixd
- name: Print ifixd
ansible.builtin.debug:
var: ifixd
when:
when:
- sync_ifix
- debug

- name: "Synchronizing {{ ifix_path }}/{{ apar_csv_filename }} from {{ apr_csv_url }}"
ansible.builtin.shell:
- name: "Synchronizing /var/lib/awx/ifix/apar.csv from {{ apr_csv_url }}"
ansible.builtin.command:
cmd: "{{ proxy }} wget -k {{ apar_csv_url }} -O {{ apar_csv_filename }}"
chdir: "{{ ifix_path }}"
changed_when: true
register: apard
when: sync_apar

- name: print apard
- name: Print apard
ansible.builtin.debug:
var: apard
when:
when:
- sync_apar
- debug

- name: "Synchronizing {{ ifix_path }}/{{ flrtvc_filename }} from {{ flrtvc_url }}"
ansible.builtin.shell:
- name: "Synchronizing /var/lib/awx/ifix/FLRTVC-latest.zip from {{ flrtvc_url }}"
ansible.builtin.command:
cmd: "{{ proxy }} wget -k {{ flrtvc_url }} -O {{ flrtvc_filename }}"
chdir: "{{ ifix_path }}"
changed_when: true
register: flrtvcd
when: sync_flrtvc

- name: print flrtvcd
- name: Print flrtvcd
ansible.builtin.debug:
var: flrtvcd
when:
when:
- sync_flrtvc
- debug

- name: "Recursive fix permissions on ifix_path {{ ifix_path }}"
ansible.builtin.file:
path: "{{ ifix_path }}"
mode: "u=rwX,g=rwX,o=rX"
recurse: yes
recurse: true
3 changes: 0 additions & 3 deletions tests/sanity/ignore-2.14.txt

This file was deleted.

3 changes: 0 additions & 3 deletions tests/sanity/ignore-2.15.txt

This file was deleted.

0 comments on commit 884f012

Please sign in to comment.