From 52f0b21ee06b149c008f845a52d30e8e6c916e05 Mon Sep 17 00:00:00 2001 From: steaksauce- Date: Wed, 10 Oct 2018 19:32:53 -0500 Subject: [PATCH 1/2] Added Windows Security Updates Example --- windows/update-windows.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 windows/update-windows.yml diff --git a/windows/update-windows.yml b/windows/update-windows.yml new file mode 100644 index 000000000..c03f6ff92 --- /dev/null +++ b/windows/update-windows.yml @@ -0,0 +1,11 @@ +--- +- name: Install all Windows Security Updates + hosts: all + + tasks: + - name: Download and Install Security Updates and Reboot + win_updates: + category_names: + - SecurityUpdates + reboot: yes + From 8341431ab40c6fade4e2a4fb5b4fa64d4c55072b Mon Sep 17 00:00:00 2001 From: steaksauce- Date: Wed, 10 Oct 2018 19:53:41 -0500 Subject: [PATCH 2/2] Added an example that installs Docker on various Linux systems --- docker-ce/install-docker-ce.yml | 185 ++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 docker-ce/install-docker-ce.yml diff --git a/docker-ce/install-docker-ce.yml b/docker-ce/install-docker-ce.yml new file mode 100644 index 000000000..73f68c0a4 --- /dev/null +++ b/docker-ce/install-docker-ce.yml @@ -0,0 +1,185 @@ +--- +- hosts: all + become: true + tasks: + + - name: Remove conflicts on Fedora + dnf: + name: "{{ item }}" + state: absent + with_items: + - docker + - docker-engine + - docker-common + - docker-engine-selinux + - docker-selinux + when: + ansible_distribution == 'Fedora' + + - name: Remove conflicts on Debian/Ubuntu + apt: + name: "{{ item }}" + state: absent + with_items: + - docker + - docker-engine + - docker.io + when: + ansible_distribution == 'Debian' + or + ansible_distribution == 'Ubuntu' + + - name: Remove conflicts on CentOS/RHEL + yum: + name: "{{ item }}" + state: absent + with_items: + - docker + - docker-engine + - docker-common + - docker-selinux + when: + ansible_distribution == 'RedHat' + or + ansible_distribution == 'CentOS' + + - name: Install Dependencies on Fedora + dnf: + name: "{{ item }}" + state: present + with_items: + - dnf-plugins-core + when: + ansible_distribution == 'Fedora' + + - name: Install Dependencies on CentOS/RHEL + yum: + name: "{{ item }}" + state: present + with_items: + - yum-utils + - device-mapper-persistent-data + - lvm2 + when: + ansible_distribution == 'RedHat' + or + ansible_distribution == 'CentOS' + + - name: Install Dependencies on Debian + apt: + name: "{{ item }}" + state: present + with_items: + - apt-transport-https + - ca-certificates + - curl + - gnupg2 + - software-properties-common + when: + ansible_distribution == 'Debian' + + - name: Install Dependencies on Ubuntu' + apt: + name: "{{ item }}" + state: present + with_items: + - apt-transport-https + - ca-certificates + - curl + - software-properties-common + when: + ansible_distribution == 'Ubuntu' + + - name: Install Repos on Fedora + yum_repository: + name: Docker-CE + description: Docker CE Repo + baseurl: https://download.docker.com/linux/fedora/$releasever/$basearch/stable + gpgkey: https://download.docker.com/linux/fedora/gpg + when: + ansible_distribution == 'Fedora' + + - name: Install Repos on CentOS + yum_repository: + name: Docker-CE + description: Docker CE Repo + baseurl: https://download.docker.com/linux/centos/$releasever/$basearch/stable + gpgkey: https://download.docker.com/linux/centos/gpg + when: + ansible_distribution == 'CentOS' + or + ansible_distribution == 'RedHat' + + - name: Install Repo Key on Debian + apt_key: + url: https://download.docker.com/linux/debian/gpg + state: present + when: + ansible_distribution == 'Debian' + + - name: Install Repo Key on Ubuntu + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: present + when: + ansible_distribution == 'Ubuntu' + + - name: Create repo line in Debian + command: bash -c "echo \"deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable\" " + register: docker_repo_line + when: + ansible_distribution == 'Debian' + + - name: Create repo line in Ubuntu + command: bash -c "echo \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" " + register: docker_repo_line + when: + ansible_distribution == 'Ubuntu' + - debug: + msg: "{{ docker_repo_line.stdout }}" + when: + ansible_distribution == 'Debian' + or + ansible_distribution == 'Ubuntu' + + - name: Add Docker Repo on Ubuntu/Debian + apt_repository: + repo: "{{ docker_repo_line.stdout }}" + state: present + when: + ansible_distribution == 'Debian' + or + ansible_distribution == 'Ubuntu' + + - name: Install docker ce on Ubuntu/Debian + apt: + name: docker-ce + state: present + update_cache: yes + when: + ansible_distribution == 'Debian' + or + ansible_distribution == 'Ubuntu' + + - name: Install docker ce on Fedora + dnf: + name: docker-ce + state: present + when: + ansible_distribution == 'Fedora' + + - name: Install docker ce on CentOS/RHEL + yum: + name: docker-ce + state: present + update_cache: yes + when: + ansible_distribution == 'RedHat' + or + ansible_distribution == 'CentOS' + + - name: Enable and start the Docker service + systemd: + name: docker + state: started + enabled: True