-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,79 @@ | ||
| --- | ||
| - name: RHEL ARM Baseline | ||
| hosts: all | ||
| become: true | ||
| hosts: all | ||
| become: true | ||
| tasks: | ||
| - name: Ensure latest packages are installed | ||
| package: | ||
| name: '*' | ||
| state: latest | ||
|
|
||
| tasks: | ||
| - name: Ensure latest packages are installed | ||
| yum: | ||
| name: '*' | ||
| state: latest | ||
| - name: Install required packages | ||
| package: | ||
| name: | ||
| - vim | ||
| - git | ||
| - 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: Remove curl-minimal if installed | ||
| package: | ||
| name: curl-minimal | ||
| state: absent | ||
|
|
||
| - 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: Install curl | ||
| package: | ||
| name: curl | ||
| state: present | ||
|
|
||
| - 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: 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: Ensure firewalld is installed and running | ||
| yum: | ||
| name: firewalld | ||
| state: present | ||
| - 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: Start and enable firewalld | ||
| service: | ||
| name: firewalld | ||
| state: started | ||
| enabled: yes | ||
| - name: Ensure firewalld is installed and running | ||
| package: | ||
| name: firewalld | ||
| state: present | ||
|
|
||
| - name: Open SSH port in firewall | ||
| firewalld: | ||
| service: ssh | ||
| permanent: true | ||
| state: enabled | ||
| immediate: yes | ||
| - name: Start and enable firewalld | ||
| service: | ||
| name: firewalld | ||
| state: started | ||
| enabled: yes | ||
|
|
||
| - name: Disable SELinux | ||
| selinux: | ||
| state: disabled | ||
| - name: Open SSH port in firewall | ||
| firewalld: | ||
| service: ssh | ||
| permanent: true | ||
| state: enabled | ||
| immediate: yes | ||
|
|
||
| - name: Set timezone to UTC | ||
| command: timedatectl set-timezone UTC | ||
| - name: Disable SELinux | ||
| selinux: | ||
| state: disabled | ||
|
|
||
| - 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: 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 |