Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions microsoft_patch_win.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
36 changes: 19 additions & 17 deletions rhel_check_sevice.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions rhel_install_packages.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions rhel_ipa_client.yml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 22 additions & 22 deletions rhel_patch_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
34 changes: 17 additions & 17 deletions rhel_satellite_client.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 15 additions & 15 deletions vmware_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions wmware_snapshot.yml
Original file line number Diff line number Diff line change
@@ -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 }}"