From 3718635e1e24a87d5122fd24dec70f1e8a694d9e Mon Sep 17 00:00:00 2001 From: lolli001 Date: Thu, 1 Aug 2024 11:31:56 -0400 Subject: [PATCH] Syntax issues --- README.md | 3 + rhel-arm-baseline.yaml | 132 ++++++++++++++++++++--------------------- 2 files changed, 69 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 14392f4..a9cd440 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,7 @@ cd ~/.aws/ terraform plan -out=plan.out | tee terraform_plan.log +#Formatting error command +yamllint 'file name' + diff --git a/rhel-arm-baseline.yaml b/rhel-arm-baseline.yaml index fb54232..475aa56 100644 --- a/rhel-arm-baseline.yaml +++ b/rhel-arm-baseline.yaml @@ -1,79 +1,79 @@ --- - name: RHEL ARM Baseline -  hosts: all -  become: true -  tasks: -    - name: Ensure latest packages are installed -      package: -        name: '*' -        state: latest +hosts: all +become: true +tasks: + - name: Ensure latest packages are installed + package: + name: '*' + state: latest -    - name: Install required packages -      package: -        name: -          - vim -          - git -          - wget -          - net-tools -          - unzip -          - epel-release -          - htop -        state: present + -name: Install require packages + package: + name: + - vim + - git + - wget + - net-tools + - unzip + - epel-release + - htop + state: present -    - name: Remove curl-minimal if installed -      package: -        name: curl-minimal -        state: absent +- name: Remove curl-minimal if installed + package: + name: curl-minimal + state: absent -    - name: Install curl -      package: -        name: curl -        state: present +- name: Install curl + package: + name: curl + 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 -      package: -        name: firewalld -        state: present + - name: Ensure firewalld is installed and running + package: + 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 \ No newline at end of file + - 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 \ No newline at end of file