mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-11-10 16:01:23 +00:00
Merge pull request #24 from bluikko/main
Add Ansible Lint action and fix lint errors
This commit is contained in:
commit
733a46258b
31
.github/workflows/ansible-lint.yml
vendored
Normal file
31
.github/workflows/ansible-lint.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
# https://github.com/ansible/ansible-lint-action
|
||||||
|
name: Ansible Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '**.yml'
|
||||||
|
- '**.yaml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ansible-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 7
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Git checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Add installed collections in Ansible configuration
|
||||||
|
run: |
|
||||||
|
echo '[defaults]' > ansible.cfg
|
||||||
|
echo 'collections_paths = ./collections' >> ansible.cfg
|
||||||
|
|
||||||
|
- name: Install requirements
|
||||||
|
run: ansible-galaxy collection install -r ansible/playbooks/requirements.yml -p collections
|
||||||
|
|
||||||
|
- name: Ansible Lint
|
||||||
|
uses: ansible/ansible-lint-action@master
|
||||||
|
with:
|
||||||
|
args: "--exclude .github"
|
@ -20,7 +20,7 @@
|
|||||||
fail_msg: "We are missing group information or ipa admin password"
|
fail_msg: "We are missing group information or ipa admin password"
|
||||||
|
|
||||||
- name: "Creating Mandatory Groups"
|
- name: "Creating Mandatory Groups"
|
||||||
ipagroup:
|
freeipa.ansible_freeipa.ipagroup:
|
||||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||||
name: "{{ ipaGroup }}"
|
name: "{{ ipaGroup }}"
|
||||||
description: "{{ ipaDescription }}"
|
description: "{{ ipaDescription }}"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
fail_msg: "We are missing user information or ipa admin password"
|
fail_msg: "We are missing user information or ipa admin password"
|
||||||
|
|
||||||
- name: "Creating User Account"
|
- name: "Creating User Account"
|
||||||
ipauser:
|
freeipa.ansible_freeipa.ipauser:
|
||||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||||
name: "{{ ipaName }}"
|
name: "{{ ipaName }}"
|
||||||
first: "{{ ipaFirst }}"
|
first: "{{ ipaFirst }}"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# Creates the first set of groups for the IdM Infrastructure
|
# Creates the first set of groups for the IdM Infrastructure
|
||||||
- name: "Creating Mandatory Groups"
|
- name: "Creating Mandatory Groups"
|
||||||
ipagroup:
|
freeipa.ansible_freeipa.ipagroup:
|
||||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||||
name: "{{ item.group }}"
|
name: "{{ item.group }}"
|
||||||
description: "{{ item.description }}"
|
description: "{{ item.description }}"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Currently only one SUDO role should be created, and that is for the
|
# Currently only one SUDO role should be created, and that is for the
|
||||||
# rocky linux admins
|
# rocky linux admins
|
||||||
- name: "Creating SUDO Role for Rocky Admins"
|
- name: "Creating SUDO Role for Rocky Admins"
|
||||||
ipasudorule:
|
freeipa.ansible_freeipa.ipasudorule:
|
||||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||||
name: All_RockyAdmins
|
name: All_RockyAdmins
|
||||||
description: Rocky Linux infrastructure and operations sudo access
|
description: Rocky Linux infrastructure and operations sudo access
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# should create both regular and admin accounts for separation of
|
# should create both regular and admin accounts for separation of
|
||||||
# privilege.
|
# privilege.
|
||||||
- name: "Creating Initial Accounts"
|
- name: "Creating Initial Accounts"
|
||||||
ipauser:
|
freeipa.ansible_freeipa.ipauser:
|
||||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
first: "{{ item.first }}"
|
first: "{{ item.first }}"
|
||||||
|
@ -20,8 +20,9 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Check for CPU Virtualization
|
- name: Check for CPU Virtualization
|
||||||
shell: "lscpu | grep -i virtualization"
|
shell: "set -o pipefail; lscpu | grep -i virtualization"
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: "result.rc != 0"
|
failed_when: "result.rc != 0"
|
||||||
|
|
||||||
# Install KVM packages
|
# Install KVM packages
|
||||||
@ -43,8 +44,9 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Verify KVM module is loaded
|
- name: Verify KVM module is loaded
|
||||||
shell: "lsmod | grep -i kvm"
|
shell: "set -o pipefail; lsmod | grep -i kvm"
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: "result.rc != 0"
|
failed_when: "result.rc != 0"
|
||||||
|
|
||||||
post_tasks:
|
post_tasks:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
fail_msg: "We are missing ipa admin password"
|
fail_msg: "We are missing ipa admin password"
|
||||||
|
|
||||||
- name: "Create Reverse Domains"
|
- name: "Create Reverse Domains"
|
||||||
ipadnszone:
|
freeipa.ansible_freeipa.ipadnszone:
|
||||||
ipaadmin_password: '{{ ipaadmin_password }}'
|
ipaadmin_password: '{{ ipaadmin_password }}'
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
with_items: '{{ rdns }}'
|
with_items: '{{ rdns }}'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
- src: freeipa.ansible_freeipa
|
collections:
|
||||||
- src: community.general
|
- freeipa.ansible_freeipa
|
||||||
|
- community.general
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
- "not no_ansible.stat.exists"
|
- "not no_ansible.stat.exists"
|
||||||
msg: "/etc/no-ansible exists - skipping run on this node"
|
msg: "/etc/no-ansible exists - skipping run on this node"
|
||||||
|
|
||||||
- name: Check if we can see LDAP srv records
|
# - name: Check if we can see LDAP srv records
|
||||||
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
@ -57,6 +57,6 @@
|
|||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: "Turn on reverse zone syncing"
|
- name: "Turn on reverse zone syncing"
|
||||||
ipadnsconfig:
|
freeipa.ansible_freeipa.ipadnsconfig:
|
||||||
ipaadmin_password: '{{ ipaadmin_password }}'
|
ipaadmin_password: '{{ ipaadmin_password }}'
|
||||||
allow_sync_ptr: true
|
allow_sync_ptr: true
|
||||||
|
Loading…
Reference in New Issue
Block a user