Skip to content

Commit

Permalink
Updated to test
Browse files Browse the repository at this point in the history
  • Loading branch information
lolli001 committed Jul 19, 2024
1 parent 19ed3ed commit 960a0be
Showing 1 changed file with 60 additions and 65 deletions.
125 changes: 60 additions & 65 deletions rhel-arm-baseline.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,71 @@

---
- name: RHEL ARM Baseline
hosts: all
become: true

name: RHEL ARM Baseline

hosts: all

become: true

tasks:

- name: Ensure latest packages are installed
yum:
name: '*'
state: latest
tasks:
- name: Ensure latest packages are installed
yum:
name: '*'
state: latest

- name: Install required packages
yum:
name:
- vim
- git
- curl
- wget
- net-tools
- unzip
- epel-release
- htop
state: present
- name: Install required packages
yum:
name:
- vim
- git
- curl
- wget
- net-tools
- unzip
- epel-release
- htop
state: present

- name: Create example user
user:
name: exampleuser
state: present
groups: wheel
shell: /bin/bash
password: "{{ 'password' | password_hash('sha512') }}" # Change 'password' to a secure password or hash
- name: Create example user
user:
name: exampleuser
state: present
groups: wheel
shell: /bin/bash
password: "{{ 'password' | password_hash('sha512') }}" # Change 'password' to a secure password or hash

- name: Configure SSH for exampleuser
authorized_key:
user: exampleuser
state: present
key: "{{ lookup('file', '/path/to/exampleuser_ssh_key.pub') }}" # Replace with the actual path to the public key
- name: Configure SSH for exampleuser
authorized_key:
user: exampleuser
state: present
key: "{{ lookup('file', '/path/to/exampleuser_ssh_key.pub') }}" # Replace with the actual path to the public key

- name: Ensure firewalld is installed and running
yum:
name: firewalld
state: present
- name: Ensure firewalld is installed and running
yum:
name: firewalld
state: present

- name: Start and enable firewalld
service:
name: firewalld
state: started
enabled: yes
- name: Start and enable firewalld
service:
name: firewalld
state: started
enabled: yes

- name: Open SSH port in firewall
firewalld:
service: ssh
permanent: true
state: enabled
immediate: yes
- name: Open SSH port in firewall
firewalld:
service: ssh
permanent: true
state: enabled
immediate: yes

- name: Disable SELinux
selinux:
state: disabled
- name: Disable SELinux
selinux:
state: disabled

- name: Set timezone to UTC
command: timedatectl set-timezone UTC
- name: Set timezone to UTC
command: timedatectl set-timezone UTC

- name: Reboot the system to apply changes
reboot:
msg: "Reboot initiated by Ansible for baseline setup"
connect_timeout: 5
reboot_timeout: 600
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: whoami
- name: Reboot the system to apply changes
reboot:
msg: "Reboot initiated by Ansible for baseline setup"
connect_timeout: 5
reboot_timeout: 600
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: whoami

0 comments on commit 960a0be

Please sign in to comment.