diff --git a/microsoft_patch_win.yml b/microsoft_patch_win.yml index f944c7b..27f2eea 100644 --- a/microsoft_patch_win.yml +++ b/microsoft_patch_win.yml @@ -1,13 +1,13 @@ --- - name: Patch Windows Servers hosts: windows_servers - gather_facts: no + gather_facts: false tasks: - name: Ensure we wait long enough for the updates to be applied during reboot ansible.windows.win_updates: reboot: true reboot_timeout: 3600 - + # - name: Install Windows Updates # win_updates: # category_names: diff --git a/rhel_check_sevice.yml b/rhel_check_sevice.yml index e35f2fe..6df9f0f 100644 --- a/rhel_check_sevice.yml +++ b/rhel_check_sevice.yml @@ -1,18 +1,20 @@ --- - - hosts: all - vars: - - package_name: firewalld - - service_name: firewalld.service - tasks: - - name: "Ensure package is installed" - yum: - name: "{{ package_name }}" - state: present - - name: "Ensure service is enabled" - service: - name: "{{ service_name }}" - enabled: yes - - name: "Ensure service is running" - service: - name: "{{ service_name }}" - state: started +- hosts: all + vars: + - package_name: firewalld + - service_name: firewalld.service + tasks: + - name: Ensure package is installed + ansible.builtin.yum: + name: "{{ package_name }}" + state: present + + - name: Ensure service is enabled + ansible.builtin.service: + name: "{{ service_name }}" + enabled: true + + - name: Ensure service is running + ansible.builtin.service: + name: "{{ service_name }}" + state: started diff --git a/rhel_install_packages.yml b/rhel_install_packages.yml index 22b9366..30026bb 100644 --- a/rhel_install_packages.yml +++ b/rhel_install_packages.yml @@ -1,14 +1,14 @@ --- -- name: Install common packages +- name: Install common packages hosts: all become: true - tasks: - - name: Install RPM packages. - yum: - name: "{{ item }}" - state: present - loop: - - vim-common - - tmux - - bash-completion + tasks: + - name: Install RPM packages. + ansible.builtin.yum: + name: "{{ item }}" + state: present + loop: + - vim-common + - tmux + - bash-completion diff --git a/rhel_ipa_client.yml b/rhel_ipa_client.yml index 8112a60..c9b911a 100644 --- a/rhel_ipa_client.yml +++ b/rhel_ipa_client.yml @@ -1,7 +1,8 @@ +--- - name: Playbook to configure IPA clients with username/password hosts: all become: true roles: - - role: ipaclient - state: present + - role: ipaclient + state: present diff --git a/rhel_patch_linux.yml b/rhel_patch_linux.yml index 086a95d..4c7ee04 100644 --- a/rhel_patch_linux.yml +++ b/rhel_patch_linux.yml @@ -2,26 +2,26 @@ - name: Patch Red Hat Enterprise Linux systems hosts: all become: true - + tasks: - - name: Update system packages - ansible.builtin.dnf: - name: '*' - state: latest - security: true - - - name: Reboot system to apply updates - ansible.builtin.reboot: - - - name: Wait for the system to come back online - ansible.builtin.wait_for_connection: - delay: 60 - timeout: 320 - - - name: Check if updates were applied - ansible.builtin.shell: yum list updates - register: result - - - name: Print result - ansible.builtin.debug: - msg: "{{ result.stdout }}" + - name: Update system packages + ansible.builtin.dnf: + name: "*" + state: latest + security: true + + - name: Reboot system to apply updates + ansible.builtin.reboot: + + - name: Wait for the system to come back online + ansible.builtin.wait_for_connection: + delay: 60 + timeout: 320 + + - name: Check if updates were applied + ansible.builtin.shell: yum list updates + register: result + + - name: Print result + ansible.builtin.debug: + msg: "{{ result.stdout }}" diff --git a/rhel_satellite_client.yml b/rhel_satellite_client.yml index c86f03f..ecfa827 100644 --- a/rhel_satellite_client.yml +++ b/rhel_satellite_client.yml @@ -1,21 +1,21 @@ --- -- name: Playbook to configure host as satellite client +- name: Playbook to configure host as satellite client hosts: all become: true - - tasks: - - name: Download katello-ca-consumer Package - get_url: - url: http://dschubba.openincite.net/pub/katello-ca-consumer-latest.noarch.rpm - dest: /tmp/katello-ca-consumer-latest.noarch.rpm - mode: '0775' - - name: Install package - yum: - name: /tmp/katello-ca-consumer-latest.noarch.rpm - state: present - -# - name: Register system using activation key -# redhat_subscription: -# org_id: "Default_Organization" -# state: present + tasks: + - name: Download katello-ca-consumer Package + ansible.builtin.get_url: + url: http://dschubba.openincite.net/pub/katello-ca-consumer-latest.noarch.rpm + dest: /tmp/katello-ca-consumer-latest.noarch.rpm + mode: "0775" + + - name: Install package + ansible.builtin.yum: + name: /tmp/katello-ca-consumer-latest.noarch.rpm + state: present + + # - name: Register system using activation key + # redhat_subscription: + # org_id: "Default_Organization" + # state: present diff --git a/vmware_template.yml b/vmware_template.yml index 69becf2..ff959b5 100644 --- a/vmware_template.yml +++ b/vmware_template.yml @@ -3,20 +3,20 @@ hosts: localhost gather_facts: false collections: - - community.vmware + - community.vmware tasks: - - name: Clone the template - vmware_guest: - validate_certs: false - folder: /vmfs/volumes/ - name: "{{ wmware_vmname }}" - state: poweredon - template: {{ vmware_template_server }} - hardware: - memory_mb: "{{ vmware_mem }}" - num_cpus: "{{ vmware_cpu }}" - disk: - - size_gb: "{{ vmware_disk }}" - type: "thin" - datastore: datastore1 + - name: Clone the template + vmware_guest: + validate_certs: false + folder: /vmfs/volumes/ + name: "{{ wmware_vmname }}" + state: poweredon + template: { { vmware_template_server: !!null "" }: !!null "" } + hardware: + memory_mb: "{{ vmware_mem }}" + num_cpus: "{{ vmware_cpu }}" + disk: + - size_gb: "{{ vmware_disk }}" + type: thin + datastore: datastore1 diff --git a/wmware_snapshot.yml b/wmware_snapshot.yml index 5aa432c..97b9d02 100644 --- a/wmware_snapshot.yml +++ b/wmware_snapshot.yml @@ -1,15 +1,15 @@ --- - name: Take virtual machine snapshot hosts: localhost - gather_facts: False + gather_facts: false tasks: - - name: Create named snapshot - community.vmware.vmware_guest_snapshot: - hostname: "{{ vcenter_hostname }}" - folder: "{{ vcenter_folder_path }}" - name: "{{ vmware_vmname }}" - snapshot_name: "{{ snapshot_name }}" - description: "{{ snapshot_description }}" - delegate_to: localhost - with_items: "{{ vcenter_hostname }}" + - name: Create named snapshot + community.vmware.vmware_guest_snapshot: + hostname: "{{ vcenter_hostname }}" + folder: "{{ vcenter_folder_path }}" + name: "{{ vmware_vmname }}" + snapshot_name: "{{ snapshot_name }}" + description: "{{ snapshot_description }}" + delegate_to: localhost + with_items: "{{ vcenter_hostname }}"