diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..329acbe --- /dev/null +++ b/.gitmodules @@ -0,0 +1,36 @@ +[submodule "deployments/consul-helm"] + path = deployments/consul-helm + url = https://github.com/hashicorp/consul-helm.git +[submodule "roles/ansible-apt-cacher-ng"] + path = roles/ansible-apt-cacher-ng + url = https://github.com/mrlesmithjr/ansible-apt-cacher-ng.git +[submodule "roles/ansible-change-hostname"] + path = roles/ansible-change-hostname + url = https://github.com/mrlesmithjr/ansible-change-hostname.git +[submodule "roles/ansible-dnsmasq"] + path = roles/ansible-dnsmasq + url = https://github.com/mrlesmithjr/ansible-dnsmasq.git +[submodule "roles/ansible-docker"] + path = roles/ansible-docker + url = https://github.com/mrlesmithjr/ansible-docker.git +[submodule "roles/ansible-etc-hosts"] + path = roles/ansible-etc-hosts + url = https://github.com/mrlesmithjr/ansible-etc-hosts.git +[submodule "roles/ansible-glusterfs"] + path = roles/ansible-glusterfs + url = https://github.com/mrlesmithjr/ansible-glusterfs.git +[submodule "roles/ansible-isc-dhcp"] + path = roles/ansible-isc-dhcp + url = https://github.com/mrlesmithjr/ansible-isc-dhcp.git +[submodule "roles/ansible-k8s"] + path = roles/ansible-k8s + url = https://github.com/mrlesmithjr/ansible-k8s.git +[submodule "roles/ansible-ntp"] + path = roles/ansible-ntp + url = https://github.com/mrlesmithjr/ansible-ntp.git +[submodule "roles/ansible-sshd"] + path = roles/ansible-sshd + url = https://github.com/mrlesmithjr/ansible-sshd.git +[submodule "roles/ansible-timezone"] + path = roles/ansible-timezone + url = https://github.com/mrlesmithjr/ansible-timezone.git diff --git a/deployments/consul-helm b/deployments/consul-helm new file mode 160000 index 0000000..78ae636 --- /dev/null +++ b/deployments/consul-helm @@ -0,0 +1 @@ +Subproject commit 78ae63636f144515f830e34885771bf7b99d91b8 diff --git a/roles/ansible-apt-cacher-ng b/roles/ansible-apt-cacher-ng new file mode 160000 index 0000000..eb87c98 --- /dev/null +++ b/roles/ansible-apt-cacher-ng @@ -0,0 +1 @@ +Subproject commit eb87c98f8c1789aedf48405e710c00c1c47e6296 diff --git a/roles/ansible-apt-cacher-ng/README.md b/roles/ansible-apt-cacher-ng/README.md deleted file mode 100644 index 3600ec2..0000000 --- a/roles/ansible-apt-cacher-ng/README.md +++ /dev/null @@ -1,69 +0,0 @@ -Role Name -========= - -An [Ansible] role to install/configure [apt-cacher-ng] -- (Client/server configurations) - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-apt-cacher-ng -apt_cacher_configs: - - 'acng.conf' - - 'security.conf' -apt_cacher_ng_account: - - name: 'admin' - password: 'admin' -apt_cacher_ng_cachedir: '/var/cache/apt-cacher-ng' -apt_cacher_ng_port: '3142' - -# Defines hostname of server -apt_cacher_server: [] - -apt_cacher_passthrough_patterns: - # Allowing everything to be cached and connected to - - '.*' - -# Defines if apt-caching should be used for clients -enable_apt_caching: false -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- -``` ---- -- hosts: all - become: true - vars: - roles: - - role: ansible-apt-cacher-ng - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: -[apt-cacher-ng]: diff --git a/roles/ansible-apt-cacher-ng/defaults/main.yml b/roles/ansible-apt-cacher-ng/defaults/main.yml deleted file mode 100644 index 70ddfca..0000000 --- a/roles/ansible-apt-cacher-ng/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# defaults file for ansible-apt-cacher-ng -apt_cacher_configs: - - 'acng.conf' - - 'security.conf' -apt_cacher_ng_account: - - name: 'admin' - password: 'admin' -apt_cacher_ng_cachedir: '/var/cache/apt-cacher-ng' -apt_cacher_ng_port: '3142' - -# Defines hostname of server -apt_cacher_server: [] - -apt_cacher_passthrough_patterns: - # Allowing everything to be cached and connected to - - '.*' - -# Defines if apt-caching should be used for clients -enable_apt_caching: false diff --git a/roles/ansible-apt-cacher-ng/handlers/main.yml b/roles/ansible-apt-cacher-ng/handlers/main.yml deleted file mode 100644 index 5fe9046..0000000 --- a/roles/ansible-apt-cacher-ng/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# handlers file for ansible-apt-cacher-ng -- name: "restart apt-cacher-ng" - service: - name: "apt-cacher-ng" - state: "restarted" diff --git a/roles/ansible-apt-cacher-ng/meta/.galaxy_install_info b/roles/ansible-apt-cacher-ng/meta/.galaxy_install_info deleted file mode 100644 index 758a049..0000000 --- a/roles/ansible-apt-cacher-ng/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Thu Feb 15 06:00:14 2018', version: ''} diff --git a/roles/ansible-apt-cacher-ng/meta/main.yml b/roles/ansible-apt-cacher-ng/meta/main.yml deleted file mode 100644 index 8a19cd6..0000000 --- a/roles/ansible-apt-cacher-ng/meta/main.yml +++ /dev/null @@ -1,127 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to install/configure [apt-cacher-ng] - #company: your company (optional) - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - # - vivid - - xenial - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - packaging - - system -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-apt-cacher-ng/tasks/debian.yml b/roles/ansible-apt-cacher-ng/tasks/debian.yml deleted file mode 100644 index 572f390..0000000 --- a/roles/ansible-apt-cacher-ng/tasks/debian.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- include: debian_client.yml - when: > - apt_cacher_server is defined and - inventory_hostname != apt_cacher_server - -- include: debian_server.yml - when: > - apt_cacher_server is defined and - inventory_hostname == apt_cacher_server diff --git a/roles/ansible-apt-cacher-ng/tasks/debian_client.yml b/roles/ansible-apt-cacher-ng/tasks/debian_client.yml deleted file mode 100644 index 953a326..0000000 --- a/roles/ansible-apt-cacher-ng/tasks/debian_client.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: config_apt_cacher | configuring apt caching (Client) - template: - src: "etc/apt/apt.conf.d/02aptcacherng.j2" - dest: "/etc/apt/apt.conf.d/02aptcacherng" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - register: "apt_caching_configured" - when: > - enable_apt_caching is defined and - enable_apt_caching - -- name: debian_client | removing apt caching (Client) - file: - path: "{{ item }}" - state: "absent" - register: "apt_caching_configured" - with_items: - # configured when node is deployed using PXE/TFTP and proxy is defined - - '/etc/apt/apt.conf' - - '/etc/apt/apt.conf.d/02aptcacherng' - when: > - (enable_apt_caching is defined and - not enable_apt_caching) or - enable_apt_caching is not defined - -- name: config_apt_cacher | refreshing apt from cache server (Client) - apt: - update_cache: yes - when: apt_caching_configured.changed diff --git a/roles/ansible-apt-cacher-ng/tasks/debian_server.yml b/roles/ansible-apt-cacher-ng/tasks/debian_server.yml deleted file mode 100644 index 0275fb7..0000000 --- a/roles/ansible-apt-cacher-ng/tasks/debian_server.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: debian | installing apt-cacher-ng (Server) - apt: - name: "apt-cacher-ng" - state: "present" - when: > - enable_apt_caching is defined and - enable_apt_caching - -- name: debian | configuring apt-cacher-ng (Server) - template: - src: "etc/apt-cacher-ng/{{ item }}.j2" - dest: "/etc/apt-cacher-ng/{{ item }}" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - notify: "restart apt-cacher-ng" - with_items: '{{ apt_cacher_configs }}' - when: > - enable_apt_caching is defined and - enable_apt_caching diff --git a/roles/ansible-apt-cacher-ng/tasks/main.yml b/roles/ansible-apt-cacher-ng/tasks/main.yml deleted file mode 100644 index 9767675..0000000 --- a/roles/ansible-apt-cacher-ng/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# tasks file for ansible-apt-cacher-ng -- include: debian.yml - when: ansible_os_family == "Debian" diff --git a/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/acng.conf.j2 b/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/acng.conf.j2 deleted file mode 100644 index 9ff52fa..0000000 --- a/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/acng.conf.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{% if apt_cacher_ng_cachedir is defined %} -CacheDir: {{ apt_cacher_ng_cachedir }} -{% endif %} -{% if apt_cacher_ng_cachedir is not defined %} -CacheDir: /var/cache/apt-cacher-ng -{% endif %} -LogDir: /var/log/apt-cacher-ng -{% if apt_cacher_ng_port is defined %} -Port:{{ apt_cacher_ng_port }} -{% endif %} -{% if apt_cacher_ng_port is not defined %} -Port:3142 -{% endif %} -ReportPage: acng-report.html -ExTreshold: 4 -LocalDirs: acng-doc /usr/share/doc/apt-cacher-ng -{% if apt_cacher_passthrough_patterns is defined %} -{% for item in apt_cacher_passthrough_patterns %} -PassThroughPattern: {{ item }} -{% endfor %} -{% endif %} diff --git a/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/security.conf.j2 b/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/security.conf.j2 deleted file mode 100644 index 4db0ae1..0000000 --- a/roles/ansible-apt-cacher-ng/templates/etc/apt-cacher-ng/security.conf.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% if apt_cacher_ng_account is defined %} -{% for item in apt_cacher_ng_account %} -AdminAuth: {{ item.name }}:{{ item.password }} -{% endfor %} -{% endif %} diff --git a/roles/ansible-apt-cacher-ng/templates/etc/apt/apt.conf.d/02aptcacherng.j2 b/roles/ansible-apt-cacher-ng/templates/etc/apt/apt.conf.d/02aptcacherng.j2 deleted file mode 100644 index 35f21d0..0000000 --- a/roles/ansible-apt-cacher-ng/templates/etc/apt/apt.conf.d/02aptcacherng.j2 +++ /dev/null @@ -1 +0,0 @@ -Acquire::http { Proxy "http://{{ apt_cacher_server }}:{{ apt_cacher_ng_port }}"; }; diff --git a/roles/ansible-apt-cacher-ng/vars/main.yml b/roles/ansible-apt-cacher-ng/vars/main.yml deleted file mode 100644 index b0360f4..0000000 --- a/roles/ansible-apt-cacher-ng/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-apt-cacher-ng diff --git a/roles/ansible-change-hostname b/roles/ansible-change-hostname new file mode 160000 index 0000000..5692da7 --- /dev/null +++ b/roles/ansible-change-hostname @@ -0,0 +1 @@ +Subproject commit 5692da748068cdaa9b0969c89ca5a2b490b95a66 diff --git a/roles/ansible-change-hostname/.travis.yml b/roles/ansible-change-hostname/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/roles/ansible-change-hostname/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/roles/ansible-change-hostname/README.md b/roles/ansible-change-hostname/README.md deleted file mode 100644 index 3d003c3..0000000 --- a/roles/ansible-change-hostname/README.md +++ /dev/null @@ -1,55 +0,0 @@ -Role Name -========= - -Changes the hostname on a node to match the inventory hostname. - -Build Status ------------- - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-change-hostname.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-change-hostname) - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-change-hostname - -# Defines if the node should reboot after changing the hostname -change_hostname_reboot: true -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-change-hostname - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com diff --git a/roles/ansible-change-hostname/defaults/main.yml b/roles/ansible-change-hostname/defaults/main.yml deleted file mode 100644 index 090b59b..0000000 --- a/roles/ansible-change-hostname/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# defaults file for ansible-change-hostname - -# Defines if the node should reboot after changing the hostname -change_hostname_reboot: true diff --git a/roles/ansible-change-hostname/handlers/main.yml b/roles/ansible-change-hostname/handlers/main.yml deleted file mode 100644 index 51b1e6f..0000000 --- a/roles/ansible-change-hostname/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-change-hostname diff --git a/roles/ansible-change-hostname/meta/.galaxy_install_info b/roles/ansible-change-hostname/meta/.galaxy_install_info deleted file mode 100644 index 80df4fe..0000000 --- a/roles/ansible-change-hostname/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:45 2018', version: ''} diff --git a/roles/ansible-change-hostname/meta/main.yml b/roles/ansible-change-hostname/meta/main.yml deleted file mode 100644 index 4d046e5..0000000 --- a/roles/ansible-change-hostname/meta/main.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: Changes the hostname on a node to match the inventory hostname. - #company: your company (optional) - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - - precise - # - quantal - # - raring - # - saucy - - trusty - - utopic - - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-change-hostname/tasks/main.yml b/roles/ansible-change-hostname/tasks/main.yml deleted file mode 100644 index 8849857..0000000 --- a/roles/ansible-change-hostname/tasks/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# tasks file for ansible-change-hostname -- name: main | changing hostname to match inventory_hostname_short - hostname: - name: "{{ inventory_hostname_short }}" - register: "hostname_status" - become: true - when: ansible_hostname != inventory_hostname_short - -- name: main | restarting machine - shell: sleep 2 && shutdown -r now "rebooting to complete hostname change" - async: 1 - poll: 0 - ignore_errors: true - become: true - when: > - (change_hostname_reboot is defined and - change_hostname_reboot ) and - hostname_status.changed - -- name: main | waiting for server to come back - wait_for: - host: "{{ ansible_host | default(inventory_hostname) }}" - port: 22 - search_regex: OpenSSH - delay: 10 - vars: - ansible_connection: local - become: false - when: > - (change_hostname_reboot is defined and - change_hostname_reboot ) and - hostname_status.changed diff --git a/roles/ansible-change-hostname/tests/test.yml b/roles/ansible-change-hostname/tests/test.yml deleted file mode 100644 index 9f4825f..0000000 --- a/roles/ansible-change-hostname/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-change-hostname - tasks: diff --git a/roles/ansible-change-hostname/vars/main.yml b/roles/ansible-change-hostname/vars/main.yml deleted file mode 100644 index 5fae5ca..0000000 --- a/roles/ansible-change-hostname/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-change-hostname diff --git a/roles/ansible-dnsmasq b/roles/ansible-dnsmasq new file mode 160000 index 0000000..283732a --- /dev/null +++ b/roles/ansible-dnsmasq @@ -0,0 +1 @@ +Subproject commit 283732a4898785bb51a0103763378040db1cd132 diff --git a/roles/ansible-dnsmasq/.gitignore b/roles/ansible-dnsmasq/.gitignore deleted file mode 100644 index 3ceac22..0000000 --- a/roles/ansible-dnsmasq/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.retry -.vagrant/ -ubuntu-yakkety-16.10-cloudimg-console.log -ubuntu-xenial-16.04-cloudimg-console.log -ubuntu-zesty-17.04-cloudimg-console.log diff --git a/roles/ansible-dnsmasq/.travis.yml b/roles/ansible-dnsmasq/.travis.yml deleted file mode 100644 index 32bf7bf..0000000 --- a/roles/ansible-dnsmasq/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: required - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - - ansible-playbook tests/test.yml -i tests/inventory - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-dnsmasq/LICENSE.md b/roles/ansible-dnsmasq/LICENSE.md deleted file mode 100644 index c294c44..0000000 --- a/roles/ansible-dnsmasq/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2017 Larry Smith Jr. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/roles/ansible-dnsmasq/README.md b/roles/ansible-dnsmasq/README.md deleted file mode 100644 index 26acf33..0000000 --- a/roles/ansible-dnsmasq/README.md +++ /dev/null @@ -1,172 +0,0 @@ -# Role Name - -An [ansible] role to install/configure [dnsmasq] - -## Requirements - -None - -## Role Variables - -```yaml ---- -# defaults file for ansible-dnsmasq - -# Define specific interfaces to listen on -dnsmasq_bind_interfaces: [] - # - "{{ ansible_default_ipv4['interface'] }}" - # - 'eth0' - # - 'eth1' - -# Defines if DNSMasq only listens on specific interfaces instead of all interfaces -dnsmasq_bind_listen_only_interfaces: false - -# Define specific domain forwarders -dnsmasq_conditional_forwarders: [] - # - address: 172.16.24.1 - # domain: 'etsbv.internal' - -# Defines if DNSMASQ should be configured -dnsmasq_config: false - -# Define custom domains per subnet, ip range, etc. -dnsmasq_custom_domains: [] - # - domain: 'test.{{ dnsmasq_pri_domain_name }}' - # network: - # - '192.168.0.0/24' # Define as subnet - # # - '192.168.0.100,192.168.1.100' # Define as range -dnsmasq_dhcp_boot: 'pxelinux.0,{{ inventory_hostname }},{{ dnsmasq_pri_bind_address }}' - -# Define static ip reservations -dnsmasq_dhcp_host_reservations: [] - # - address: 192.168.0.60 - # lease_time: '1h' - # mac_address: - # - '11:22:33:44:55:66' # Multiple MAC addresses may be assigned - # # - '12:34:56:78:90:12' - # name: 'fred' - -# Define DHCP options to set -dnsmasq_dhcp_options: - - option: 'dns-server' - value: - - 192.168.202.200 - - 192.168.202.201 - # - option: 'domain-name' - # value: - # - 'another.{{ dnsmasq_pri_domain_name }}' - - option: 'domain-search' - value: - - 'dev.{{ dnsmasq_pri_domain_name }}' - - 'prod.{{ dnsmasq_pri_domain_name }}' - - 'test.{{ dnsmasq_pri_domain_name }}' - - option: 'ntp-server' - value: - - 192.168.202.200 - - 192.168.202.201 - - option: 'router' - value: - - 192.168.202.1 - -# Define dhcp scopes to be used if dhcp is enabled -dnsmasq_dhcp_scopes: - - start: 192.168.1.128 - end: 192.168.1.224 - netmask: 255.255.255.0 - # lease_time: '24h' # Define a specific lease time if desired..Default is 1h - # interface: 'eth0' # Define a specific interface to provide scope...not required but useful - # - start: 192.168.2.128 - # end: 192.168.2.224 - # netmask: 255.255.255.0 - # lease_time: '24h' - # interface: 'eth1' - -# Define your dns search -dnsmasq_dns_search: '{{ dnsmasq_pri_domain_name }}' - -# Define any interface to not listen on -dnsmasq_do_not_listen_on_interfaces: [] - # - 'eth0' - -# Defines if DHCP services are provided by DNSMASQ -dnsmasq_enable_dhcp: false - -# Defines if forwarders should be used -dnsmasq_enable_forwarders: false - -# Defines if TFTP services are provided by DNSMASQ -dnsmasq_enable_tftp: false - -# Never forward addresses in the non-routed address spaces -dnsmasq_forward_nonrouted_addresses: false - -# Define listen port for DNS -# Default=53 -# Set to 0 to disable DNS -dnsmasq_listen_port: 53 - -# Define your dns servers -dnsmasq_nameservers: - - 8.8.4.4 - - 8.8.8.8 - -dnsmasq_pri_bind_address: "{{ ansible_default_ipv4['address'] }}" -dnsmasq_pri_domain_name: 'example.org' - -# Defines netmask cidr value -# 255.255.255.0 == 24 -dnsmasq_pri_netmask_cidr: 24 - -dnsmasq_pri_network: "{{ ansible_default_ipv4['network'] }}" - -# Defines if you want dnsmasq to read /etc/hosts -dnsmasq_read_etc_hosts: true - - # Define if /etc/resolv.conf should be polled for changes -dnsmasq_poll_etc_resolv_conf: true - -# Define if /etc/resolv.conf should be read -dnsmasq_read_etc_resolv_conf: true - -# Define static addresses -dnsmasq_static_addresses: [] - # - address: 192.168.202.133 - # name: 'node1.test.com' - -# Define tftpboot directory -dnsmasq_tftpboot_dir: '/var/lib/tftpboot' -``` - -## Dependencies - -None - -## Example Playbook - -```yaml ---- -- hosts: all - become: true - vars: - roles: - - role: ansible-dnsmasq - tasks: -``` - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [@mrlesmithjr] -- -- mrlesmithjr [at] gmail.com - -[@mrlesmithjr]: https://www.twitter.com/mrlesmithjr - -[ansible]: https://ansible.com - -[dnsmasq]: http://www.thekelleys.org.uk/dnsmasq/doc.html diff --git a/roles/ansible-dnsmasq/Vagrantfile b/roles/ansible-dnsmasq/Vagrantfile deleted file mode 100644 index 4380fdc..0000000 --- a/roles/ansible-dnsmasq/Vagrantfile +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure(2) do |config| - config.vm.box = "mrlesmithjr/trusty64" - config.vm.provision :shell, path: "provision.sh" -end diff --git a/roles/ansible-dnsmasq/defaults/main.yml b/roles/ansible-dnsmasq/defaults/main.yml deleted file mode 100644 index 7e905ae..0000000 --- a/roles/ansible-dnsmasq/defaults/main.yml +++ /dev/null @@ -1,126 +0,0 @@ ---- -# defaults file for ansible-dnsmasq - -# Define specific interfaces to listen on -dnsmasq_bind_interfaces: [] - # - "{{ ansible_default_ipv4['interface'] }}" - # - 'eth0' - # - 'eth1' - -# Defines if DNSMasq only listens on specific interfaces instead of all interfaces -dnsmasq_bind_listen_only_interfaces: false - -# Define specific domain forwarders -dnsmasq_conditional_forwarders: [] - # - address: 172.16.24.1 - # domain: 'etsbv.internal' - -# Defines if DNSMASQ should be configured -dnsmasq_config: false - -# Define custom domains per subnet, ip range, etc. -dnsmasq_custom_domains: [] - # - domain: 'test.{{ dnsmasq_pri_domain_name }}' - # network: - # - '192.168.0.0/24' # Define as subnet - # # - '192.168.0.100,192.168.1.100' # Define as range -dnsmasq_dhcp_boot: 'pxelinux.0,{{ inventory_hostname }},{{ dnsmasq_pri_bind_address }}' - -# Define static ip reservations -dnsmasq_dhcp_host_reservations: [] - # - address: 192.168.0.60 - # lease_time: '1h' - # mac_address: - # - '11:22:33:44:55:66' # Multiple MAC addresses may be assigned - # # - '12:34:56:78:90:12' - # name: 'fred' - -# Define DHCP options to set -dnsmasq_dhcp_options: - - option: 'dns-server' - value: - - 192.168.202.200 - - 192.168.202.201 - # - option: 'domain-name' - # value: - # - 'another.{{ dnsmasq_pri_domain_name }}' - - option: 'domain-search' - value: - - 'dev.{{ dnsmasq_pri_domain_name }}' - - 'prod.{{ dnsmasq_pri_domain_name }}' - - 'test.{{ dnsmasq_pri_domain_name }}' - - option: 'ntp-server' - value: - - 192.168.202.200 - - 192.168.202.201 - - option: 'router' - value: - - 192.168.202.1 - -# Define dhcp scopes to be used if dhcp is enabled -dnsmasq_dhcp_scopes: - - start: 192.168.1.128 - end: 192.168.1.224 - netmask: 255.255.255.0 - # lease_time: '24h' # Define a specific lease time if desired..Default is 1h - # interface: 'eth0' # Define a specific interface to provide scope...not required but useful - # - start: 192.168.2.128 - # end: 192.168.2.224 - # netmask: 255.255.255.0 - # lease_time: '24h' - # interface: 'eth1' - -# Define your dns search -dnsmasq_dns_search: '{{ dnsmasq_pri_domain_name }}' - -# Define any interface to not listen on -dnsmasq_do_not_listen_on_interfaces: [] - # - 'eth0' - -# Defines if DHCP services are provided by DNSMASQ -dnsmasq_enable_dhcp: false - -# Defines if forwarders should be used -dnsmasq_enable_forwarders: false - -# Defines if TFTP services are provided by DNSMASQ -dnsmasq_enable_tftp: false - -# Never forward addresses in the non-routed address spaces -dnsmasq_forward_nonrouted_addresses: false - -# Define listen port for DNS -# Default=53 -# Set to 0 to disable DNS -dnsmasq_listen_port: 53 - -# Define your dns servers -dnsmasq_nameservers: - - 8.8.4.4 - - 8.8.8.8 - -dnsmasq_pri_bind_address: "{{ ansible_default_ipv4['address'] }}" -dnsmasq_pri_domain_name: 'example.org' - -# Defines netmask cidr value -# 255.255.255.0 == 24 -dnsmasq_pri_netmask_cidr: 24 - -dnsmasq_pri_network: "{{ ansible_default_ipv4['network'] }}" - -# Defines if you want dnsmasq to read /etc/hosts -dnsmasq_read_etc_hosts: true - - # Define if /etc/resolv.conf should be polled for changes -dnsmasq_poll_etc_resolv_conf: true - -# Define if /etc/resolv.conf should be read -dnsmasq_read_etc_resolv_conf: true - -# Define static addresses -dnsmasq_static_addresses: [] - # - address: 192.168.202.133 - # name: 'node1.test.com' - -# Define tftpboot directory -dnsmasq_tftpboot_dir: '/var/lib/tftpboot' diff --git a/roles/ansible-dnsmasq/handlers/main.yml b/roles/ansible-dnsmasq/handlers/main.yml deleted file mode 100644 index 6530e38..0000000 --- a/roles/ansible-dnsmasq/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# handlers file for ansible-dnsmasq -- name: restart dnsmasq - service: - name: dnsmasq - state: restarted - become: true diff --git a/roles/ansible-dnsmasq/meta/.galaxy_install_info b/roles/ansible-dnsmasq/meta/.galaxy_install_info deleted file mode 100644 index 8d12450..0000000 --- a/roles/ansible-dnsmasq/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:46 2018', version: ''} diff --git a/roles/ansible-dnsmasq/meta/main.yml b/roles/ansible-dnsmasq/meta/main.yml deleted file mode 100644 index f1a0d7d..0000000 --- a/roles/ansible-dnsmasq/meta/main.yml +++ /dev/null @@ -1,140 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to install/configure [DNSMasq] - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - - name: Fedora - versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - - 22 - - 23 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - # - name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - # - 42.1 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - - vivid - - wily - - xenial - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - # - all - # - etch - - jessie - # - lenny - # - squeeze - - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - - networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-dnsmasq/playbook.yml b/roles/ansible-dnsmasq/playbook.yml deleted file mode 100644 index fc0fd4d..0000000 --- a/roles/ansible-dnsmasq/playbook.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - become: true - vars: - - dnsmasq_config: true - roles: - - role: ansible-dnsmasq - tasks: diff --git a/roles/ansible-dnsmasq/provision.sh b/roles/ansible-dnsmasq/provision.sh deleted file mode 100755 index f26894f..0000000 --- a/roles/ansible-dnsmasq/provision.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -sudo apt-get update -sudo apt-get install -y git python-pip python-dev -sudo pip install jinja2 -sudo pip install ansible -sudo ansible-galaxy install -r /vagrant/requirements.yml -f -#sudo mkdir -p /etc/ansible/roles -#sudo git clone --branch=dev https://github.com/mrlesmithjr/ansible-dnsmasq.git /etc/ansible/roles/ansible-dnsmasq -ansible-playbook -i "localhost," -c local /vagrant/playbook.yml diff --git a/roles/ansible-dnsmasq/requirements.yml b/roles/ansible-dnsmasq/requirements.yml deleted file mode 100644 index 2f79177..0000000 --- a/roles/ansible-dnsmasq/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- src: https://github.com/mrlesmithjr/ansible-dnsmasq.git diff --git a/roles/ansible-dnsmasq/tasks/alpine.yml b/roles/ansible-dnsmasq/tasks/alpine.yml deleted file mode 100644 index facba39..0000000 --- a/roles/ansible-dnsmasq/tasks/alpine.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: alpine | Installing DNSMasq - apk: - name: "dnsmasq" - state: "present" - become: true diff --git a/roles/ansible-dnsmasq/tasks/config_dnsmasq.yml b/roles/ansible-dnsmasq/tasks/config_dnsmasq.yml deleted file mode 100644 index 1ac9599..0000000 --- a/roles/ansible-dnsmasq/tasks/config_dnsmasq.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: dnsmasq_config | Configuring DNSMasq - template: - src: "etc/dnsmasq.conf.j2" - dest: "/etc/dnsmasq.conf" - owner: "root" - group: "root" - mode: 0644 - notify: "restart dnsmasq" - become: true - -- name: dnsmasq_config | Ensuring {{ dnsmasq_tftpboot_dir }} Exists - file: - path: "{{ dnsmasq_tftpboot_dir }}" - state: "directory" - become: true - when: > - (dnsmasq_enable_tftp is defined and - dnsmasq_enable_tftp) diff --git a/roles/ansible-dnsmasq/tasks/debian.yml b/roles/ansible-dnsmasq/tasks/debian.yml deleted file mode 100644 index 8ab7c30..0000000 --- a/roles/ansible-dnsmasq/tasks/debian.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: debian | Installing DNSMasq - apt: - name: "dnsmasq" - state: "present" - become: true diff --git a/roles/ansible-dnsmasq/tasks/main.yml b/roles/ansible-dnsmasq/tasks/main.yml deleted file mode 100644 index 7627992..0000000 --- a/roles/ansible-dnsmasq/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# tasks file for ansible-dnsmasq -- include: alpine.yml - when: ansible_os_family == "Alpine" - -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: opensuse.yml - when: ansible_os_family == "openSUSE Leap" - -- include: config_dnsmasq.yml - tags: - - dnsmasq_config - when: dnsmasq_config diff --git a/roles/ansible-dnsmasq/tasks/opensuse.yml b/roles/ansible-dnsmasq/tasks/opensuse.yml deleted file mode 100644 index f38042a..0000000 --- a/roles/ansible-dnsmasq/tasks/opensuse.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: opensuse | Installing DNSMasq - zypper: - name: "dnsmasq" - state: "present" - become: true - -- name: opensuse | Ensuring DNSMasq Service Is Enabled and Started - service: - name: "dnsmasq" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-dnsmasq/tasks/redhat.yml b/roles/ansible-dnsmasq/tasks/redhat.yml deleted file mode 100644 index f06668a..0000000 --- a/roles/ansible-dnsmasq/tasks/redhat.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: redhat | Installing DNSMasq - yum: - name: "dnsmasq" - state: "present" - become: true - when: ansible_distribution != "Fedora" - -- name: redhat | Installing DNSMasq - dnf: - name: "dnsmasq" - state: "present" - become: true - when: ansible_distribution == "Fedora" - -- name: redhat | Ensuring DNSMasq Service is Enabled and Started - service: - name: "dnsmasq" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-dnsmasq/templates/etc/dnsmasq.conf.j2 b/roles/ansible-dnsmasq/templates/etc/dnsmasq.conf.j2 deleted file mode 100644 index 0594f14..0000000 --- a/roles/ansible-dnsmasq/templates/etc/dnsmasq.conf.j2 +++ /dev/null @@ -1,74 +0,0 @@ -port={{ dnsmasq_listen_port }} -{% if not dnsmasq_read_etc_hosts %} -no-hosts -{% endif %} -{% if not dnsmasq_read_etc_resolv_conf %} -no-resolv -{% endif %} -{% if not dnsmasq_poll_etc_resolv_conf %} -no-poll -{% endif %} -{% if dnsmasq_bind_interfaces is defined %} -{% for item in dnsmasq_bind_interfaces %} -interface={{ item }} -{% endfor %} -{% endif %} -{% if dnsmasq_bind_listen_only_interfaces %} -bind-interfaces -{% elif not dnsmasq_bind_listen_only_interfaces %} -{% endif %} -{% if dnsmasq_do_not_listen_on_interfaces is defined %} -{% for item in dnsmasq_do_not_listen_on_interfaces %} -except-interface={{ item }} -{% endfor %} -{% endif %} -{% if dnsmasq_forward_nonrouted_addresses %} -bogus-priv -{% elif not dnsmasq_forward_nonrouted_addresses %} -{% endif %} -{% if dnsmasq_pri_domain_name is defined %} -domain={{ dnsmasq_pri_domain_name }} -{% endif %} -{% if dnsmasq_custom_domains is defined %} -{% for item in dnsmasq_custom_domains %} -domain={{ item['domain'] }},{{ item['network']|join (',') }} -{% endfor %} -{% endif %} -{% if dnsmasq_enable_forwarders %} -{% for item in dnsmasq_nameservers %} -server={{ item }} -{% endfor %} -{% endif %} -{% if dnsmasq_static_addresses is defined %} -{% for item in dnsmasq_static_addresses %} -address=/{{ item['name'] }}/{{ item['address'] }} -{% endfor %} -{% endif %} -{% if dnsmasq_conditional_forwarders is defined %} -{% for item in dnsmasq_conditional_forwarders %} -server=/{{ item['domain'] }}/{{ item['address'] }} -{% endfor %} -{% endif %} -{% if dnsmasq_enable_tftp %} -enable-tftp -tftp-root={{ dnsmasq_tftpboot_dir }} -{% endif %} -{% if dnsmasq_enable_dhcp %} -dhcp-client-update -dhcp-boot={{ dnsmasq_dhcp_boot }} -{% if dnsmasq_dhcp_host_reservations is defined %} -{% for item in dnsmasq_dhcp_host_reservations %} -dhcp-host={{ item['mac_address']|join(',') }}{% if item['name'] is defined %},{{ item['name'] }}{% endif %}{% if item['address'] is defined %},{{ item['address'] }}{% endif %}{% if item['lease_time'] is defined %},{{ item['lease_time'] }}{% endif %} - -{% endfor %} -{% endif %} -{% if dnsmasq_dhcp_options is defined %} -{% for item in dnsmasq_dhcp_options %} -dhcp-option=option:{{ item['option'] }},{{ item['value']|join(',') }} -{% endfor %} -{% endif %} -{% for item in dnsmasq_dhcp_scopes %} -dhcp-range={% if item['interface'] is defined %}{{ item['interface'] }},{% endif %}{{ item['start'] }},{{ item['end'] }},{{ item['netmask'] }}{% if item['lease_time'] is defined %},{{ item['lease_time'] }}{% endif %} - -{% endfor %} -{% endif %} diff --git a/roles/ansible-dnsmasq/tests/inventory b/roles/ansible-dnsmasq/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-dnsmasq/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-dnsmasq/tests/test.yml b/roles/ansible-dnsmasq/tests/test.yml deleted file mode 100644 index 00d81c1..0000000 --- a/roles/ansible-dnsmasq/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - roles: - - ansible-dnsmasq diff --git a/roles/ansible-dnsmasq/vars/main.yml b/roles/ansible-dnsmasq/vars/main.yml deleted file mode 100644 index aca62cd..0000000 --- a/roles/ansible-dnsmasq/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-dnsmasq diff --git a/roles/ansible-docker b/roles/ansible-docker new file mode 160000 index 0000000..181daf1 --- /dev/null +++ b/roles/ansible-docker @@ -0,0 +1 @@ +Subproject commit 181daf19c0d31014c500139cf512e112b013845f diff --git a/roles/ansible-docker/.travis.yml b/roles/ansible-docker/.travis.yml deleted file mode 100644 index 1d51420..0000000 --- a/roles/ansible-docker/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: required - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - # - ansible-playbook tests/test.yml -i tests/inventory - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-docker/LICENSE b/roles/ansible-docker/LICENSE deleted file mode 100644 index 120bed5..0000000 --- a/roles/ansible-docker/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Larry Smith Jr. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/ansible-docker/README.md b/roles/ansible-docker/README.md deleted file mode 100644 index 4934243..0000000 --- a/roles/ansible-docker/README.md +++ /dev/null @@ -1,238 +0,0 @@ - - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [ansible-docker](#ansible-docker) - - [Build Status](#build-status) - - [Requirements](#requirements) - - [Role Variables](#role-variables) - - [Dependencies](#dependencies) - - [Example Playbook](#example-playbook) - - [License](#license) - - [Author Information](#author-information) - - - -# ansible-docker - -An [Ansible](https://www.ansible.com) role to install/configure [Docker](https://www.docker.com) - -## Build Status - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-docker.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-docker) - -## Requirements - -None - -## Role Variables - -```yaml ---- -# defaults file for ansible-docker - -# Ensure this exists if setting docker to alternate data directory -# We do not create this to ensure any add'l mounts do not overlay this path -# Service may fail to start if not. -docker_alt_data_dir: '/mnt/docker' - -# Defines address of cluster address -# Not the same as Swarm Cluster address -# Ex. Consul -docker_cluster_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_cluster_interface]['ipv4']['address'] }}" - -# Defines interface to capture address from for docker_cluster_addr -docker_cluster_interface: "{{ docker_swarm_interface }}" - -docker_cluster_port: 2376 - -# Defines if docker should be configured to store data in alternate location -# ensure to enable -g option in docker_opts if true -docker_config_alt_data_dir: false - -# Defines if docker service should be configured -docker_config_service: false - -# Defines if users defined in docker_users should be added to docker group -docker_config_users: false - -# Defines docker images to be installed -docker_images: [] - # # Defines image name - # # ex. docker hub image name - # - name: 'centos' - # # Defines state of image - # # present|absent - # state: 'present' - # - name: 'elasticsearch' - # state: 'present' - # - name: 'fedora' - # state: 'present' - # - name: 'ubuntu' - # state: 'present' - -# Defines if images defined in docker_images are managed -docker_manage_images: false - -# Defines docker service options to be configured in /etc/docker/daemon.json -# Configure each option the same naming/format as the variables are set as at -# https://docs.docker.com/engine/reference/commandline/dockerd/ -# The values are converted directly to proper JSON using the Jinja2 template -docker_opts: -# Only define bridge or bip if you want to use either one of these -# They cannot be used together -# Specify network bridge IP - # bip: '172.17.0.1/8' -# Attach containers to a network bridge - # bridge: 'docker0' -# Address or interface name to advertise - # cluster-advertise: '{{ docker_cluster_addr }}:{{ docker_cluster_port }}' -# Set cluster store options - # cluster-store: 'consul://192.168.250.10:8500' -# Enable debug mode - debug: false -# Container default gateway IPv4 address - # default-gateway: '10.10.10.1' -# Default ulimits for containers - # default-ulimit: - # - nofile: '64000:64000' -# DNS server to use - # dns: - # - '8.8.8.8' - # - '8.8.4.4' -# DNS search domains to use - # dns-search: - # - 'etsbv.internal' - # - 'etsbv.test' -# Enable insecure registry communication - # insecure-registries: - # - 'gitlab.etsbv.internal:5000' -# Default IP when binding container ports - # ip: '0.0.0.0' -# Enable net.ipv4.ip_forward - ip-forward: true -# Enable IP masquerading - ip-masq: true -# Enable addition of iptables rules - iptables: true -# Set key=value labels to the daemon - # label: - # - environment: 'test' - # - datacenter: 'atlanta' -# Default driver for container logs -# Default is json-file - log-driver: 'json-file' -# Fluentd log driver setup - # log-driver: 'fluentd' - # log-opts: - # fluentd-address: 'fluentdhost:24224' - # # fluentd-address: tcp://fluentdhost:24224 -# End of Fluentd log driver setup -# GELF (Graylog) log driver setup - # log-driver: 'gelf' - # log-opts: - # gelf-address: 'udp://1.2.3.4:12201' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of GELF (Graylog) log driver setup -# Splunk log driver setup - # log-driver: 'splunk' - # log-opts: - # splunk-token: '176FCEBF-4CF5-4EDF-91BC-703796522D20' - # splunk-url: 'https://splunkhost:8088' - # splunk-capath: '/path/to/cert/cacert.pem' - # splunk-caname: 'SplunkServerDefaultCert' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of Splunk log driver setup -# Syslog log driver setup - # log-driver: 'syslog' - # log-opts: - # # Define syslog address or leave commented out for logging to host local - # # syslog. - # # syslog-address: 'udp://1.2.3.4:1111' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# Set the logging level - log-level: 'info' -# Set the max concurrent downloads for each pull - max-concurrent-downloads: 3 -# Set the max concurrent uploads for each push - max-concurrent-uploads: 5 -# Set the containers network MTU - # mtu: 1500 -# Enable selinux support - selinux-enabled: false -# Storage driver to use -# aufs, devicemapper, btrfs, zfs, overlay and overlay2 - # storage-driver: 'aufs' -# Set default address or interface for swarm advertised address - swarm-default-advertise-addr: "{{ docker_swarm_addr }}" -# Use TLS; implied by –tlsverify - # tls: false - -# Defines which repo to install from -# Stable gives you reliable updates every quarter -# Edge gives you new features every month -# define as stable or edge -docker_release_channel: 'stable' - -# Defines if docker memory limits should be added to grub boot loader -docker_set_grub_memory_limit: true - -docker_swarm_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_swarm_interface]['ipv4']['address'] }}" - -docker_swarm_interface: 'enp0s8' - -# Defines docker ubuntu repo info for installing from -docker_ubuntu_repo_info: - id: '0EBFCD88' - # keyserver: 'hkp://p80.pool.sks-keyservers.net:80' - repo: 'deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_release_channel }}' - url: 'https://download.docker.com/linux/ubuntu/gpg' - -# Defines users to be added to docker group to allow non sudo access to docker -docker_users: [] - # - 'vagrant' - -# Define Docker version to install -# 1.11.0|1.11.1|1.11.2|1.12.0|1.12.1|1.12.2|1.12.3|1.12.4|1.12.5|1.12.6|1.13.0|1.13.1 -# 17.03.0|17.03.1|17.03.2|17.04.0|17.05.0|17.06.0 -# Currently as of 06/03/2017 17.04.0 and 17.05.0 must be installed from the -# edge channel. Change docker_release_channel: 'edge' -docker_version: 17.06.0 -``` - -## Dependencies - -None - -## Example Playbook - -```yaml ---- -- hosts: docker_hosts - vars: - docker_swarm_interface: "eth1" - docker_config_service: true - pri_domain_name: 'test.vagrant.local' - roles: - - role: ansible-docker - tasks: -``` - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) -- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) -- [mrlesmithjr.com](http://mrlesmithjr.com) -- mrlesmithjr [at] gmail.com diff --git a/roles/ansible-docker/defaults/main.yml b/roles/ansible-docker/defaults/main.yml deleted file mode 100644 index 9f03a47..0000000 --- a/roles/ansible-docker/defaults/main.yml +++ /dev/null @@ -1,176 +0,0 @@ ---- -# defaults file for ansible-docker - -# Ensure this exists if setting docker to alternate data directory -# We do not create this to ensure any add'l mounts do not overlay this path -# Service may fail to start if not. -docker_alt_data_dir: '/mnt/docker' - -# Defines address of cluster address -# Not the same as Swarm Cluster address -# Ex. Consul -docker_cluster_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_cluster_interface]['ipv4']['address'] }}" - -# Defines interface to capture address from for docker_cluster_addr -docker_cluster_interface: "{{ docker_swarm_interface }}" - -docker_cluster_port: 2376 - -# Defines if docker should be configured to store data in alternate location -# ensure to enable -g option in docker_opts if true -docker_config_alt_data_dir: false - -# Defines if docker service should be configured -docker_config_service: false - -# Defines if users defined in docker_users should be added to docker group -docker_config_users: false - -# Defines docker images to be installed -docker_images: [] - # # Defines image name - # # ex. docker hub image name - # - name: 'centos' - # # Defines state of image - # # present|absent - # state: 'present' - # - name: 'elasticsearch' - # state: 'present' - # - name: 'fedora' - # state: 'present' - # - name: 'ubuntu' - # state: 'present' - -# Defines if images defined in docker_images are managed -docker_manage_images: false - -# Defines docker service options to be configured in /etc/docker/daemon.json -# Configure each option the same naming/format as the variables are set as at -# https://docs.docker.com/engine/reference/commandline/dockerd/ -# The values are converted directly to proper JSON using the Jinja2 template -docker_opts: -# Only define bridge or bip if you want to use either one of these -# They cannot be used together -# Specify network bridge IP - # bip: '172.17.0.1/8' -# Attach containers to a network bridge - # bridge: 'docker0' -# Address or interface name to advertise - # cluster-advertise: '{{ docker_cluster_addr }}:{{ docker_cluster_port }}' -# Set cluster store options - # cluster-store: 'consul://192.168.250.10:8500' -# Enable debug mode - debug: false -# Container default gateway IPv4 address - # default-gateway: '10.10.10.1' -# Default ulimits for containers - # default-ulimit: - # - nofile: '64000:64000' -# DNS server to use - # dns: - # - '8.8.8.8' - # - '8.8.4.4' -# DNS search domains to use - # dns-search: - # - 'etsbv.internal' - # - 'etsbv.test' -# Enable insecure registry communication - # insecure-registries: - # - 'gitlab.etsbv.internal:5000' -# Default IP when binding container ports - # ip: '0.0.0.0' -# Enable net.ipv4.ip_forward - ip-forward: true -# Enable IP masquerading - ip-masq: true -# Enable addition of iptables rules - iptables: true -# Set key=value labels to the daemon - # label: - # - environment: 'test' - # - datacenter: 'atlanta' -# Default driver for container logs -# Default is json-file - log-driver: 'json-file' -# Fluentd log driver setup - # log-driver: 'fluentd' - # log-opts: - # fluentd-address: 'fluentdhost:24224' - # # fluentd-address: tcp://fluentdhost:24224 -# End of Fluentd log driver setup -# GELF (Graylog) log driver setup - # log-driver: 'gelf' - # log-opts: - # gelf-address: 'udp://1.2.3.4:12201' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of GELF (Graylog) log driver setup -# Splunk log driver setup - # log-driver: 'splunk' - # log-opts: - # splunk-token: '176FCEBF-4CF5-4EDF-91BC-703796522D20' - # splunk-url: 'https://splunkhost:8088' - # splunk-capath: '/path/to/cert/cacert.pem' - # splunk-caname: 'SplunkServerDefaultCert' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of Splunk log driver setup -# Syslog log driver setup - # log-driver: 'syslog' - # log-opts: - # # Define syslog address or leave commented out for logging to host local - # # syslog. - # # syslog-address: 'udp://1.2.3.4:1111' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# Set the logging level - log-level: 'info' -# Set the max concurrent downloads for each pull - max-concurrent-downloads: 3 -# Set the max concurrent uploads for each push - max-concurrent-uploads: 5 -# Set the containers network MTU - # mtu: 1500 -# Enable selinux support - selinux-enabled: false -# Storage driver to use -# aufs, devicemapper, btrfs, zfs, overlay and overlay2 - # storage-driver: 'aufs' -# Set default address or interface for swarm advertised address - swarm-default-advertise-addr: "{{ docker_swarm_addr }}" -# Use TLS; implied by –tlsverify - # tls: false - -# Defines which repo to install from -# Stable gives you reliable updates every quarter -# Edge gives you new features every month -# define as stable or edge -docker_release_channel: 'stable' - -# Defines if docker memory limits should be added to grub boot loader -docker_set_grub_memory_limit: true - -docker_swarm_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_swarm_interface]['ipv4']['address'] }}" - -docker_swarm_interface: 'enp0s8' - -# Defines docker ubuntu repo info for installing from -docker_ubuntu_repo_info: - id: '0EBFCD88' - # keyserver: 'hkp://p80.pool.sks-keyservers.net:80' - repo: 'deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_release_channel }}' - url: 'https://download.docker.com/linux/ubuntu/gpg' - -# Defines users to be added to docker group to allow non sudo access to docker -docker_users: [] - # - 'vagrant' - -# Define Docker version to install -# 1.11.0|1.11.1|1.11.2|1.12.0|1.12.1|1.12.2|1.12.3|1.12.4|1.12.5|1.12.6|1.13.0|1.13.1 -# 17.03.0|17.03.1|17.03.2|17.04.0|17.05.0|17.06.0 -# Currently as of 06/03/2017 17.04.0 and 17.05.0 must be installed from the -# edge channel. Change docker_release_channel: 'edge' -docker_version: 17.06.0 diff --git a/roles/ansible-docker/handlers/main.yml b/roles/ansible-docker/handlers/main.yml deleted file mode 100644 index f770f2e..0000000 --- a/roles/ansible-docker/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# handlers file for ansible-docker -- name: restart docker - service: - name: "docker" - state: restarted - become: true diff --git a/roles/ansible-docker/meta/.galaxy_install_info b/roles/ansible-docker/meta/.galaxy_install_info deleted file mode 100644 index 8d12450..0000000 --- a/roles/ansible-docker/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:46 2018', version: ''} diff --git a/roles/ansible-docker/meta/main.yml b/roles/ansible-docker/meta/main.yml deleted file mode 100644 index 12d8fe1..0000000 --- a/roles/ansible-docker/meta/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible](https://www.ansible.com) role to install/configure [Docker](https://www.docker.com) - - license: license (MIT) - min_ansible_version: 1.2 - - platforms: - - name: EL - versions: - - 7 - - name: Ubuntu - versions: - - precise - - trusty - - xenial - - zesty - - name: Debian - versions: - - jessie - - stretch - - categories: - - cloud - - development - - packaging - - system -dependencies: [] diff --git a/roles/ansible-docker/tasks/alpine.yml b/roles/ansible-docker/tasks/alpine.yml deleted file mode 100644 index c3310ab..0000000 --- a/roles/ansible-docker/tasks/alpine.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: alpine | Ensuring Edge Repo Is Enabled - lineinfile: - path: "/etc/apk/repositories" - regexp: "^http://dl-cdn.alpinelinux.org/alpine/edge/community" - line: "http://dl-cdn.alpinelinux.org/alpine/edge/community" - state: "present" - register: "_apk_repos_updated" - become: true - -- name: alpine | Updating APK Cache - apk: - update_cache: true - become: true - when: _apk_repos_updated['changed'] - -- name: alpine | Installing Docker - apk: - name: "docker" - state: "present" - become: true diff --git a/roles/ansible-docker/tasks/config_docker.yml b/roles/ansible-docker/tasks/config_docker.yml deleted file mode 100644 index f9a794b..0000000 --- a/roles/ansible-docker/tasks/config_docker.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: config_docker | Configuring Docker Service (Debian) - template: - src: "etc/default/docker.j2" - dest: "/etc/default/docker" - owner: "root" - group: "root" - mode: 0644 - notify: "restart docker" - become: true - when: ansible_os_family == "Debian" - -- name: config_docker | Ensuring /etc/docker Folder Exists - file: - path: "/etc/docker" - state: "directory" - become: true - -- name: config_docker | Configuring Docker - template: - src: "etc/docker/daemon.json.j2" - dest: "/etc/docker/daemon.json" - notify: "restart docker" - become: true diff --git a/roles/ansible-docker/tasks/debian.yml b/roles/ansible-docker/tasks/debian.yml deleted file mode 100644 index 4d823fd..0000000 --- a/roles/ansible-docker/tasks/debian.yml +++ /dev/null @@ -1,95 +0,0 @@ ---- -- name: debian | updating apt-cache - apt: - update_cache: yes - cache_valid_time: 86400 - become: true - -- name: debian | installing pre-reqs - apt: - name: "{{ item }}" - state: present - become: true - with_items: - - 'apt-transport-https' - - 'ca-certificates' - - 'software-properties-common' - -# We are removing the old Docker info -- name: debian | Removing Legacy Docker apt-key - apt_key: - keyserver: "hkp://p80.pool.sks-keyservers.net:80" - id: "58118E89F3A912897C070ADBF76221572C52609D" - state: "absent" - become: true - -# We are removing the old Docker info -- name: debian | Removing Legacy Docker Repo - apt_repository: - repo: "deb https://apt.dockerproject.org/repo {{ ansible_distribution | lower }}-{{ ansible_distribution_release }} main" - state: "absent" - become: true - -- name: debian | adding docker apt-key - apt_key: - url: "{{ docker_ubuntu_repo_info['url'] }}" - id: "{{ docker_ubuntu_repo_info['id'] }}" - state: "present" - become: true - -- name: debian | adding docker repo - apt_repository: - repo: "{{ docker_ubuntu_repo_info['repo'] }}" - state: present - become: true - -# We remove docker-engine as this is old package to install. The new package is -# docker-ce -- name: debian | uninstalling old docker package (if exists) - apt: - name: "{{ item }}" - state: "absent" - purge: yes - become: true - with_items: - - 'docker-engine' - - 'lxc-docker' - -- name: debian | installing docker pre-reqs - apt: - name: "linux-image-extra-{{ ansible_kernel }}" - state: present - become: true - when: > - ansible_distribution == "Ubuntu" and - (ansible_distribution_version >= '14.04') - -- name: debian | installing docker - apt: - name: "docker-ce={{ docker_version_debian }}" - state: "present" - become: true - -- name: debian | setting grub memory limit (if set) - lineinfile: - dest: /etc/default/grub - regexp: "^GRUB_CMDLINE_LINUX_DEFAULT" - line: 'GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1"' - register: grub_updated - become: true - when: > - docker_set_grub_memory_limit is defined and - docker_set_grub_memory_limit - -- name: debian | updating grub (if updated) - command: update-grub - become: true - when: grub_updated['changed'] - -- name: debian | installing additonal packages - apt: - name: "{{ item }}" - state: "present" - become: true - with_items: - - bridge-utils diff --git a/roles/ansible-docker/tasks/images.yml b/roles/ansible-docker/tasks/images.yml deleted file mode 100644 index 1a42ed3..0000000 --- a/roles/ansible-docker/tasks/images.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: images | ensuring docker images are present - docker_image: - name: "{{ item['name'] }}" - state: "{{ item['state'] }}" - become: true - with_items: '{{ docker_images }}' diff --git a/roles/ansible-docker/tasks/main.yml b/roles/ansible-docker/tasks/main.yml deleted file mode 100644 index 0c3300a..0000000 --- a/roles/ansible-docker/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# tasks file for ansible-docker -- include: set_facts.yml - -- include: alpine.yml - when: ansible_os_family == "Alpine" - -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: config_docker.yml - when: docker_config_service - -- include: service.yml - -- include: users.yml - when: > - docker_config_users is defined and - docker_config_users - -- include: manage_python_modules.yml - -- include: images.yml - when: > - docker_manage_images and - docker_images is defined diff --git a/roles/ansible-docker/tasks/manage_python_modules.yml b/roles/ansible-docker/tasks/manage_python_modules.yml deleted file mode 100644 index 1da4a78..0000000 --- a/roles/ansible-docker/tasks/manage_python_modules.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -- name: manage_python_modules | installing python pre-req packages (Debian) - apt: - name: "{{ item }}" - state: present - become: true - with_items: - - 'build-essential' - - 'libffi-dev' - - 'libssl-dev' - - 'python-dev' - - 'python-pip' - - 'python-setuptools' - when: ansible_os_family == "Debian" - -- name: manage_python_modules | installing python pre-req packages (RedHat) - yum: - name: "{{ item }}" - state: present - become: true - with_items: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - - 'redhat-rpm-config' - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -- name: manage_python_modules | Installing Ansible Pre-Reqs (Fedora) - dnf: - name: "python-dnf" - state: "present" - become: true - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: manage_python_modules | installing python pre-req packages (Fedora) - dnf: - name: "{{ item }}" - state: present - become: true - with_items: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - - 'redhat-rpm-config' - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: manage_python_modules | installing python modules - pip: - name: "{{ item }}" - state: present - become: true - with_items: - - 'docker-compose' - # - 'docker-py' diff --git a/roles/ansible-docker/tasks/redhat.yml b/roles/ansible-docker/tasks/redhat.yml deleted file mode 100644 index fd866f7..0000000 --- a/roles/ansible-docker/tasks/redhat.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -- name: redhat | Installing Pre-Reqs (Fedora) - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'device-mapper-persistent-data' - - 'libselinux-python' - - 'lvm2' - - 'yum-utils' - when: ansible_distribution == "Fedora" - -- name: redhat | Installing Pre-Reqs (!=Fedora) - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'device-mapper-persistent-data' - - 'libselinux-python' - - 'lvm2' - - 'yum-utils' - when: ansible_distribution != "Fedora" - -- name: redhat | Uninstalling Old Docker Package (if exists) - yum: - name: "{{ item }}" - state: "absent" - become: true - with_items: - - 'container-selinux' - - 'docker-common' - - 'docker-engine' - - 'docker-selinux' - - 'docker' - -- name: redhat | adding Docker repo - template: - src: "etc/yum.repos.d/docker.repo.j2" - dest: "/etc/yum.repos.d/docker.repo" - become: true - -- name: redhat | installing Docker - yum: - name: "docker-ce-{{ docker_version_redhat }}" - state: present - become: true - when: ansible_distribution != "Fedora" - -- name: redhat | installing Docker - dnf: - name: "docker-ce-{{ docker_version_redhat }}" - state: present - become: true - when: ansible_distribution == "Fedora" diff --git a/roles/ansible-docker/tasks/service.yml b/roles/ansible-docker/tasks/service.yml deleted file mode 100644 index 75f6754..0000000 --- a/roles/ansible-docker/tasks/service.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: service | Ensuring Docker Service Is Started And Enabled On Boot - service: - name: "docker" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-docker/tasks/set_facts.yml b/roles/ansible-docker/tasks/set_facts.yml deleted file mode 100644 index e9ddf56..0000000 --- a/roles/ansible-docker/tasks/set_facts.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}-0~{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version < '1.12.4') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}-0~{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '1.12.4' and - docker_version <= '1.13.1') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}~ce-0~{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '17.03' and - docker_version < '17.06') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}~ce-0~{{ ansible_distribution|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '17.06') - -- name: set_facts | Setting Docker Version To Install (Fedora) - set_fact: - docker_version_redhat: '{{ docker_version }}-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution == "Fedora") and - (docker_version < '17.03') - -- name: set_facts | Setting Docker Version To Install (Fedora) - set_fact: - docker_version_redhat: '{{ docker_version }}.ce-1.fc{{ ansible_distribution_major_version }}' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution == "Fedora") and - (docker_version >= '17.03') - -- name: set_facts | Setting Docker Version To Install (RedHat) - set_fact: - docker_version_redhat: '{{ docker_version }}-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution != "Fedora") and - (docker_version < '17.03') and - ansible_distribution_major_version == '7' - -- name: set_facts | Setting Docker Version To Install (RedHat) - set_fact: - docker_version_redhat: '{{ docker_version }}.ce-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution != "Fedora") and - (docker_version >= '17.03') and - ansible_distribution_major_version == '7' - -- name: Installing Docker Version On Debian - debug: msg="Installing Docker Version {{ docker_version_debian }}" - when: ansible_os_family == "Debian" - -- name: Installing Docker Version On RedHat - debug: msg="Installing Docker Version {{ docker_version_redhat }}" - when: ansible_os_family == "RedHat" diff --git a/roles/ansible-docker/tasks/users.yml b/roles/ansible-docker/tasks/users.yml deleted file mode 100644 index 3bbe4d3..0000000 --- a/roles/ansible-docker/tasks/users.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: users | adding docker users (for use without sudo) - user: - name: "{{ item }}" - append: yes - groups: docker - become: true - with_items: '{{ docker_users }}' diff --git a/roles/ansible-docker/templates/etc/default/docker.j2 b/roles/ansible-docker/templates/etc/default/docker.j2 deleted file mode 100644 index 06474d0..0000000 --- a/roles/ansible-docker/templates/etc/default/docker.j2 +++ /dev/null @@ -1 +0,0 @@ -DOCKER_OPTS="--config-file=/etc/docker/daemon.json" diff --git a/roles/ansible-docker/templates/etc/docker/daemon.json.j2 b/roles/ansible-docker/templates/etc/docker/daemon.json.j2 deleted file mode 100644 index 083eee9..0000000 --- a/roles/ansible-docker/templates/etc/docker/daemon.json.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% if docker_opts is defined %} -{{ docker_opts|to_nice_json }} -{% endif %} diff --git a/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig b/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig deleted file mode 100644 index 2a75e25..0000000 --- a/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig +++ /dev/null @@ -1,66 +0,0 @@ -{% set docker_options = {} %} -{% if docker_opts.bridge is defined %} -{% set _opts = docker_options.update({"bridge": docker_opts.bridge}) %} -{% endif %} -{% if docker_opts.bridge_ip is defined %} -{% set _opts = docker_options.update({"bip": docker_opts.bridge_ip}) %} -{% endif %} -{% if docker_opts.dns is defined %} -{% set _dns_servers = [] %} -{% for item in docker_opts.dns %} -{% set _opts = _dns_servers.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"dns": _dns_servers}) %} -{% endif %} -{% if docker_opts.dns_search is defined %} -{% set _dns_search = [] %} -{% for item in docker_opts.dns_search %} -{% set _opts = _dns_search.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"dns-search": _dns_search}) %} -{% endif %} -{% if docker_opts.insecure_registries is defined %} -{% set _insecure_registries = [] %} -{% for item in docker_opts.insecure_registries %} -{% set _opts = _insecure_registries.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"insecure-registries": _insecure_registries}) %} -{% endif %} -{% if docker_opts.ip is defined %} -{% set _opts = docker_options.update({"ip": docker_opts.ip}) %} -{% endif %} -{% if docker_opts.ip_forward is defined %} -{% set _opts = docker_options.update({"ip-forward": docker_opts.ip_forward}) %} -{% endif %} -{% if docker_opts.ip_masq is defined %} -{% set _opts = docker_options.update({"ip-masq": docker_opts.ip_masq}) %} -{% endif %} -{% if docker_opts.iptables is defined %} -{% set _opts = docker_options.update({"iptables": docker_opts.iptables}) %} -{% endif %} -{% if docker_opts.labels is defined %} -{% set _labels = [] %} -{% for item in docker_opts.labels %} -{% set _opts = _labels.append(item.key+"="+item.value) %} -{% endfor %} -{% set _opts = docker_options.update({"labels": _labels}) %} -{% endif %} -{% if docker_opts.log_driver is defined %} -{% set _opts = docker_options.update({"log-driver": docker_opts.log_driver}) %} -{% endif %} -{% if docker_opts.log_level is defined %} -{% set _opts = docker_options.update({"log-level": docker_opts.log_level}) %} -{% endif %} -{% if docker_opts.max_concurrent_downloads is defined %} -{% set _opts = docker_options.update({"max-concurrent-downloads": docker_opts.max_concurrent_downloads|int}) %} -{% endif %} -{% if docker_opts.max_concurrent_uploads is defined %} -{% set _opts = docker_options.update({"max-concurrent-uploads": docker_opts.max_concurrent_uploads|int}) %} -{% endif %} -{% if docker_opts.storage_driver is defined %} -{% set _opts = docker_options.update({"storage-driver": docker_opts.storage_driver}) %} -{% endif %} -{% if docker_opts.tls is defined %} -{% set _opts = docker_options.update({"tls": docker_opts.tls}) %} -{% endif %} -{{ docker_options| to_nice_json }} diff --git a/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 b/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 deleted file mode 100644 index b5e3430..0000000 --- a/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 +++ /dev/null @@ -1,20 +0,0 @@ -[docker-ce-{{ docker_release_channel }}] -name=Docker CE {{ docker_release_channel }} - $basearch -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/$basearch/{{ docker_release_channel }} -enabled=1 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg - -[docker-ce-{{ docker_release_channel }}-debuginfo] -name=Docker CE {{ docker_release_channel }} - Debuginfo $basearch -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/debug-$basearch/{{ docker_release_channel }} -enabled=0 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg - -[docker-ce-{{ docker_release_channel }}-source] -name=Docker CE {{ docker_release_channel }} - Sources -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/source/{{ docker_release_channel }} -enabled=0 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg diff --git a/roles/ansible-docker/tests/inventory b/roles/ansible-docker/tests/inventory deleted file mode 100644 index 2fbb50c..0000000 --- a/roles/ansible-docker/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/ansible-docker/tests/test.yml b/roles/ansible-docker/tests/test.yml deleted file mode 100644 index 1b0f1d4..0000000 --- a/roles/ansible-docker/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-docker - tasks: diff --git a/roles/ansible-docker/vars/main.yml b/roles/ansible-docker/vars/main.yml deleted file mode 100644 index 5e2444b..0000000 --- a/roles/ansible-docker/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-docker diff --git a/roles/ansible-etc-hosts b/roles/ansible-etc-hosts new file mode 160000 index 0000000..472eb2d --- /dev/null +++ b/roles/ansible-etc-hosts @@ -0,0 +1 @@ +Subproject commit 472eb2d8ece1de323caf5f694ca9499f6d3e538b diff --git a/roles/ansible-etc-hosts/.travis.yml b/roles/ansible-etc-hosts/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/roles/ansible-etc-hosts/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/roles/ansible-etc-hosts/README.md b/roles/ansible-etc-hosts/README.md deleted file mode 100644 index 5d8e07d..0000000 --- a/roles/ansible-etc-hosts/README.md +++ /dev/null @@ -1,65 +0,0 @@ -Role Name -========= - -An [Ansible] role that Configures /etc/hosts - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-etc-hosts -# Defines if all nodes in play should be added to each hosts /etc/hosts -etc_hosts_add_all_hosts: false - -# Defines if ipv6 info is included in /etc/hosts -etc_hosts_enable_ipv6: true - -# Defines your primary dns suffix -etc_hosts_pri_dns_name: 'vagrant.local' - -# Defines if node has static IP. -etc_hosts_static_ip: false - -# Defines if ansible_host is used for defining hosts -etc_hosts_use_ansible_ssh_host: true - -# Defines if ansible_default_ipv4.address is used for defining hosts -etc_hosts_use_default_ip_address: false -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-etc-hosts -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-etc-hosts/defaults/main.yml b/roles/ansible-etc-hosts/defaults/main.yml deleted file mode 100644 index 2291b56..0000000 --- a/roles/ansible-etc-hosts/defaults/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# defaults file for ansible-etc-hosts -# Defines if all nodes in play should be added to each hosts /etc/hosts -etc_hosts_add_all_hosts: false - -# Defines if ipv6 info is included in /etc/hosts -etc_hosts_enable_ipv6: true - -# Defines your primary dns suffix -etc_hosts_pri_dns_name: 'vagrant.local' - -# Defines if node has static IP. -etc_hosts_static_ip: false - -# Defines if ansible_host is used for defining hosts -etc_hosts_use_ansible_ssh_host: true - -# Defines if ansible_default_ipv4.address is used for defining hosts -etc_hosts_use_default_ip_address: false diff --git a/roles/ansible-etc-hosts/handlers/main.yml b/roles/ansible-etc-hosts/handlers/main.yml deleted file mode 100644 index a202eb9..0000000 --- a/roles/ansible-etc-hosts/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-etc-hosts diff --git a/roles/ansible-etc-hosts/meta/.galaxy_install_info b/roles/ansible-etc-hosts/meta/.galaxy_install_info deleted file mode 100644 index 8d12450..0000000 --- a/roles/ansible-etc-hosts/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:46 2018', version: ''} diff --git a/roles/ansible-etc-hosts/meta/main.yml b/roles/ansible-etc-hosts/meta/main.yml deleted file mode 100644 index 764e269..0000000 --- a/roles/ansible-etc-hosts/meta/main.yml +++ /dev/null @@ -1,149 +0,0 @@ -galaxy_info: - author: Larry Smith Jr. - description: An Ansible role that configures /etc/hosts - #company: your company (optional) - - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - - min_ansible_version: 1.2 - - # Optionally specify the branch Galaxy will use when accessing the GitHub - # repo for this role. During role install, if no tags are available, - # Galaxy will use this branch. During import Galaxy will access files on - # this branch. If travis integration is cofigured, only notification for this - # branch will be accepted. Otherwise, in all cases, the repo's default branch - # (usually master) will be used. - #github_branch: - - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Solaris - # versions: - # - all - # - 10 - # - 11.0 - # - 11.1 - # - 11.2 - # - 11.3 - - name: Fedora - versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - - 20 - - 21 - - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - - galaxy_tags: - # List tags for your role here, one per line. A tag is - # a keyword that describes and categorizes the role. - # Users find roles by searching for tags. Be sure to - # remove the '[]' above if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of - # alphanumeric characters. Maximum 20 tags per role. - - system - -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-etc-hosts/tasks/main.yml b/roles/ansible-etc-hosts/tasks/main.yml deleted file mode 100644 index a31f818..0000000 --- a/roles/ansible-etc-hosts/tasks/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# tasks file for ansible-etc-hosts -- name: pre-reqs (RedHat) - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - libselinux-python - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -- name: pre-reqs (RedHat) - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - libselinux-python - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: main | updating /etc/hosts (localhost) - template: - src: "etc/hosts.j2" - dest: "/etc/hosts" - owner: root - group: root - mode: 0644 - become: true diff --git a/roles/ansible-etc-hosts/templates/etc/hosts.j2 b/roles/ansible-etc-hosts/templates/etc/hosts.j2 deleted file mode 100644 index c0781ee..0000000 --- a/roles/ansible-etc-hosts/templates/etc/hosts.j2 +++ /dev/null @@ -1,81 +0,0 @@ -127.0.0.1 localhost - -{% if not etc_hosts_add_all_hosts %} -{% if (ansible_domain == etc_hosts_pri_dns_name) or ansible_domain == '' %} -{% if not etc_hosts_static_ip %} -{% if inventory_hostname == inventory_hostname_short %} -{% if ansible_fqdn != (ansible_hostname + '.' + etc_hosts_pri_dns_name) %} -127.0.1.1 {{ ansible_hostname }}.{{ etc_hosts_pri_dns_name }} {{ ansible_hostname }} -{% elif ansible_fqdn == (ansible_hostname + '.' + etc_hosts_pri_dns_name) %} -127.0.1.1 {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% if inventory_hostname != inventory_hostname_short %} -{% if ansible_fqdn != inventory_hostname %} -127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} -{% elif ansible_fqdn == inventory_hostname %} -127.0.1.1 {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% elif etc_hosts_static_ip %} -{% if ansible_ssh_host is defined %} -{{ ansible_ssh_host }} {{ ansible_fqdn }} {{ ansible_hostname }} -{% elif ansible_host is defined %} -{{ ansible_host }} {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% elif (ansible_domain != etc_hosts_pri_dns_name) and ansible_domain != '' %} -{% if (ansible_fqdn == inventory_hostname) and (inventory_hostname != inventory_hostname_short) %} -{% if not etc_hosts_static_ip %} -127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} -{% elif etc_hosts_static_ip %} -{% if ansible_ssh_host is defined %} -{{ ansible_ssh_host }} {{ inventory_hostname }} {{ ansible_hostname }} -{% elif ansible_host is defined %} -{{ ansible_host }} {{ inventory_hostname }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% endif %} -{% endif %} -{% elif etc_hosts_add_all_hosts %} -{% for host in play_hosts %} -{% if (hostvars[host]['ansible_domain'] == etc_hosts_pri_dns_name) or hostvars[host]['ansible_domain'] == '' %} -{% if etc_hosts_use_default_ip_address and not etc_hosts_use_ansible_ssh_host %} -{{ hostvars[host]['ansible_default_ipv4']['address'] }} {{ hostvars[host]['ansible_fqdn'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% elif not etc_hosts_use_default_ip_address and etc_hosts_use_ansible_ssh_host %} -{% if hostvars[host]['ansible_fqdn'] != (hostvars[host]['ansible_hostname']+ '.' + etc_hosts_pri_dns_name) %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_hostname'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_hostname'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% elif hostvars[host]['ansible_fqdn'] == (hostvars[host]['ansible_hostname']+ '.' + etc_hosts_pri_dns_name) %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% endif %} -{% endif %} -{% elif (hostvars[host]['ansible_domain'] != etc_hosts_pri_dns_name) and ansible_domain != '' %} -{% if (hostvars[host]['ansible_fqdn'] == inventory_hostname) and (inventory_hostname != inventory_hostname_short) %} -{% if etc_hosts_use_default_ip_address and not etc_hosts_use_ansible_ssh_host %} -{{ hostvars[host]['ansible_default_ipv4']['address'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif not etc_hosts_use_default_ip_address and etc_hosts_use_ansible_ssh_host %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% endif %} -{% endif %} -{% endif %} -{% endfor %} -{% endif %} - -{% if etc_hosts_enable_ipv6 %} -# The following lines are desirable for IPv6 capable hosts -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -{% endif %} diff --git a/roles/ansible-etc-hosts/tests/inventory b/roles/ansible-etc-hosts/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-etc-hosts/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-etc-hosts/tests/test.yml b/roles/ansible-etc-hosts/tests/test.yml deleted file mode 100644 index b642979..0000000 --- a/roles/ansible-etc-hosts/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-etc-hosts \ No newline at end of file diff --git a/roles/ansible-etc-hosts/vars/main.yml b/roles/ansible-etc-hosts/vars/main.yml deleted file mode 100644 index 8a754aa..0000000 --- a/roles/ansible-etc-hosts/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-etc-hosts diff --git a/roles/ansible-glusterfs b/roles/ansible-glusterfs new file mode 160000 index 0000000..fd30e90 --- /dev/null +++ b/roles/ansible-glusterfs @@ -0,0 +1 @@ +Subproject commit fd30e904d2d595a2a01a1c405ec2fd8cdd6eb089 diff --git a/roles/ansible-glusterfs/README.md b/roles/ansible-glusterfs/README.md deleted file mode 100644 index ec7efe4..0000000 --- a/roles/ansible-glusterfs/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# ansible-glusterfs - -An [Ansible](https://www.ansible.com) role to install/configure [GlusterFS](http://www.gluster.org/) - -## Requirements - -Add hard drive devices to server nodes to configure for LVM bricks and -set `glusterfs_config_lvm: true` - -## Role Variables - -[defaults/main.yml](defaults/main.yml) - -## Dependencies - -None - -## Example Playbook - -[playbook.yml](./playbook.yml) - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) -- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) -- diff --git a/roles/ansible-glusterfs/defaults/main.yml b/roles/ansible-glusterfs/defaults/main.yml deleted file mode 100644 index ef7fbdf..0000000 --- a/roles/ansible-glusterfs/defaults/main.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -# defaults file for ansible-glusterfs - -# defines if glusterfs should be configured -config_glusterfs: false - -# defines the Ansible inventory group for arbiter nodes to add to cluster (if desired) -glusterfs_arbiter_group: glusterfs-arbiter-nodes - -# defines the mountpoint for gluster bricks and volumes to be created -glusterfs_brick_dir: /mnt/gluster - -# defines the Ansible inventory group for clients -glusterfs_client_group: glusterfs_client_nodes - -glusterfs_client_mounts: [] - # - mountpoint: /mnt/scripts - # src: '{{ glusterfs_primary_server }}:/scripts' - # fstype: 'glusterfs' - # opts: 'defaults,_netdev,backupvolfile-server={{ glusterfs_secondary_server }}' - # state: mounted - # - mountpoint: /mnt/webs - # src: '{{ glusterfs_primary_server }}:/webs' - # fstype: 'glusterfs' - # opts: 'defaults,_netdev,backupvolfile-server={{ glusterfs_secondary_server }}' - # state: mounted - -# defines if lvm should be configured -glusterfs_config_lvm: false - -# defines glusterfs bricks to create...these will be hidden folders -glusterfs_create_bricks: [] - # - name: scripts - # owner: root - # group: root - # - name: webs - # owner: root - # group: root - -# defines Debian repo for GlusterFS -glusterfs_debian_repo_info: - key_url: "https://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_version }}/rsa.pub" - repo: "deb http://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_version }}/LATEST/Debian/{{ ansible_distribution_release|lower }}/apt {{ ansible_distribution_release|lower }} main" - -# defines if nodes are using iSCSI for back-end LVM... -glusterfs_iscsi_lvm: false - -# defines GlusterFS LVM volumes to create (Used for GlusterFS Bricks) -glusterfs_lvm_vols: [] - # - lvname: glusterfs-lv - # disks: - # - /dev/sdb - # - /dev/sdc - # filesystem: xfs - # lvsize: 100%FREE - # mountpoint: '{{ glusterfs_brick_dir }}' - # opts: 'rw,inode64,noatime,nouuid' - # vgname: glusterfs-vg - -# define if arbiter nodes should be managed or added to cluster -glusterfs_manage_arbiter_nodes: false - -# defines primary server for GlusterFS clients to connect to -glusterfs_primary_server: '{{ glusterfs_server_master }}' - -# defines secondary server for GlusterFS clients to connect to -glusterfs_secondary_server: "{{ groups[glusterfs_server_group][1] }}" - -# defines interface to configure for glusterfs replication -glusterfs_repl_int_address: ansible_eth1.ipv4.address - -# defines if lvm should be resized -glusterfs_resize_lvm: false - -glusterfs_resize_lvm_size: +100%FREE - -# defines the hosts inventory group to configure -glusterfs_server_group: glusterfs_server_nodes - -# defines the node to be considered as GlusterFS master -glusterfs_server_master: "{{ groups[glusterfs_server_group][0] }}" - -# defines Ubuntu repo for GlusterFS -glusterfs_ubuntu_repo_info: - keyserver: keyserver.ubuntu.com - id: F7C73FCC930AC9F83B387A5613E01B7B3FE869A9 - repo: "deb http://ppa.launchpad.net/gluster/glusterfs-{{ glusterfs_version }}/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }} main " - -glusterfs_version: '3.10' - -# If brick is being created in the root partition, module will fail. -# Set force to true to override this behaviour. -glusterfs_volume_force_create: false diff --git a/roles/ansible-glusterfs/handlers/main.yml b/roles/ansible-glusterfs/handlers/main.yml deleted file mode 100644 index da55361..0000000 --- a/roles/ansible-glusterfs/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-glusterfs diff --git a/roles/ansible-glusterfs/meta/.galaxy_install_info b/roles/ansible-glusterfs/meta/.galaxy_install_info deleted file mode 100644 index 6cb8a18..0000000 --- a/roles/ansible-glusterfs/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:47 2018', version: ''} diff --git a/roles/ansible-glusterfs/meta/main.yml b/roles/ansible-glusterfs/meta/main.yml deleted file mode 100644 index b647fe9..0000000 --- a/roles/ansible-glusterfs/meta/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: Installs GlusterFS http://www.gluster.org/ (configures and creates cluster) - - license: MIT - - min_ansible_version: 1.2 - - platforms: - - name: Debian - versions: - - stretch - - name: Ubuntu - versions: - - trusty - - xenial - - categories: - - clustering - - system - -dependencies: [] diff --git a/roles/ansible-glusterfs/playbook.yml b/roles/ansible-glusterfs/playbook.yml deleted file mode 100644 index 1860b1f..0000000 --- a/roles/ansible-glusterfs/playbook.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- hosts: glusterfs - vars: - config_glusterfs: true - etc_hosts_add_all_hosts: true - etc_hosts_pri_dns_name: "{{ pri_domain_name }}" - etc_hosts_static_ip: true - glusterfs_client_mounts: - - mountpoint: /mnt/volume-1 - src: "{{ glusterfs_primary_server }}:/volume-1" - fstype: glusterfs - opts: "defaults,_netdev,backupvolfile-server={{ glusterfs_secondary_server }}" - state: mounted - - mountpoint: /mnt/volume-2 - src: "{{ glusterfs_primary_server }}:/volume-2" - fstype: glusterfs - opts: "defaults,_netdev,backupvolfile-server={{ glusterfs_secondary_server }}" - state: mounted - - mountpoint: /mnt/volume-3 - src: "{{ glusterfs_primary_server }}:/volume-3" - fstype: glusterfs - opts: "defaults,_netdev,backupvolfile-server={{ glusterfs_secondary_server }}" - state: mounted - glusterfs_create_bricks: - - name: volume-1 - owner: root - group: root - - name: volume-2 - owner: root - group: root - - name: volume-3 - owner: root - group: root - glusterfs_volume_force_create: true - pri_domain_name: test.vagrant.local - roles: - - role: ansible-etc-hosts - - role: ansible-glusterfs - become: true diff --git a/roles/ansible-glusterfs/tasks/config_glusterfs_client.yml b/roles/ansible-glusterfs/tasks/config_glusterfs_client.yml deleted file mode 100644 index 2d07d2a..0000000 --- a/roles/ansible-glusterfs/tasks/config_glusterfs_client.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: config_glusterfs_client | mounting gluster volumes - mount: - name: "{{ item.mountpoint }}" - src: "{{ item.src }}" - fstype: "{{ item.fstype }}" - opts: "{{ item.opts|default ('omit') }}" - state: "{{ item.state }}" - with_items: '{{ glusterfs_client_mounts }}' diff --git a/roles/ansible-glusterfs/tasks/config_glusterfs_server.yml b/roles/ansible-glusterfs/tasks/config_glusterfs_server.yml deleted file mode 100644 index 59f9021..0000000 --- a/roles/ansible-glusterfs/tasks/config_glusterfs_server.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- name: config_glusterfs_server | reconfiguring /etc/init/mounting-glusterfs.conf to start earlier on boot - template: - src: "etc/init/mounting-glusterfs.conf.j2" - dest: "/etc/init/mounting-glusterfs.conf" - owner: root - group: root - mode: 0644 - -- name: config_glusterfs_server | connecting gluster peers - shell: gluster peer probe {{ item }} - register: gluster_peer_probe - changed_when: "'already in peer list' not in gluster_peer_probe.stdout" - ignore_errors: true #added temporarily to get around Vagrant testing...may remove later - delegate_to: "{{ glusterfs_server_master }}" - with_items: '{{ groups[glusterfs_server_group] }}' - when: > - item != glusterfs_server_master and - ((groups[glusterfs_arbiter_group] is defined and - inventory_hostname not in groups[glusterfs_arbiter_group]) or - groups[glusterfs_arbiter_group] is not defined) - -- name: config_glusterfs_server | creating brick folders - file: - path: "{{ glusterfs_brick_dir }}/.{{ item.name }}/" - owner: "{{ item.owner }}" - group: "{{ item.group }}" - state: directory - with_items: '{{ glusterfs_create_bricks }}' - when: > - ((groups[glusterfs_arbiter_group] is defined and - inventory_hostname not in groups[glusterfs_arbiter_group]) or - groups[glusterfs_arbiter_group] is not defined) - -- name: config_glusterfs_server | Capture Gluster Volumes - command: "gluster volume list" - register: "gluster_volumes" - # We do this to ensure this executes in --check mode - check_mode: no - changed_when: false - -- name: config_glusterfs_server | create gluster volume - gluster_volume: - state: present - name: "{{ item.name }}" - brick: "{{ glusterfs_brick_dir }}/.{{ item.name }}" - force: "{{ glusterfs_volume_force_create }}" - replicas: "{{ groups[glusterfs_server_group]|length }}" - cluster: "{% for host in groups[glusterfs_server_group] %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %}" - with_items: '{{ glusterfs_create_bricks }}' - when: > - inventory_hostname == glusterfs_server_master and - item.name not in gluster_volumes.stdout diff --git a/roles/ansible-glusterfs/tasks/config_lvm.yml b/roles/ansible-glusterfs/tasks/config_lvm.yml deleted file mode 100644 index cc585a0..0000000 --- a/roles/ansible-glusterfs/tasks/config_lvm.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -- name: config_lvm | installing packages - apt: - name: "{{ item }}" - state: present - with_items: - - lvm2 - - scsitools - - xfsprogs - when: ansible_os_family == "Debian" - -- name: config_lvm | installing lvm2 - yum: - name: "{{ item }}" - state: present - with_items: - - sg3_utils - - system-storage-manager - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -- name: config_lvm | installing lvm2 - dnf: - name: "{{ item }}" - state: present - with_items: - - sg3_utils - - system-storage-manager - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: config_lvm | rescanning for new disks - command: /sbin/rescan-scsi-bus - changed_when: false - when: ansible_os_family == "Debian" - -- name: config_lvm | rescanning for new disks - command: /usr/bin/rescan-scsi-bus.sh - changed_when: false - when: ansible_os_family == "RedHat" - -- name: config_lvm | creating new LVM volume group - lvg: - vg: "{{ item.vgname }}" - pvs: "{{ item.disks|join(',') }}" - state: present - with_items: '{{ glusterfs_lvm_vols }}' - -- name: config_lvm | creating new LVM logical volume - lvol: - vg: "{{ item.vgname }}" - lv: "{{ item.lvname }}" - size: "{{ item.lvsize }}" - with_items: '{{ glusterfs_lvm_vols }}' - -- name: config_lvm | creating new filesystem on new LVM logical volume - filesystem: - fstype: "{{ item.filesystem }}" - dev: "/dev/{{ item.vgname }}/{{ item.lvname }}" - with_items: '{{ glusterfs_lvm_vols }}' - -- name: config_lvm | mounting new filesystem - mount: - name: "{{ item.mountpoint }}" - src: "/dev/{{ item.vgname }}/{{ item.lvname }}" - fstype: "{{ item.filesystem }}" - opts: "{{ item.opts }}" - dump: "1" - passno: "2" - state: mounted - with_items: '{{ glusterfs_lvm_vols }}' diff --git a/roles/ansible-glusterfs/tasks/debian.yml b/roles/ansible-glusterfs/tasks/debian.yml deleted file mode 100644 index 021569d..0000000 --- a/roles/ansible-glusterfs/tasks/debian.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -- name: debian | installing pre-reqs - apt: - name: "{{ item }}" - state: present - with_items: - - python-software-properties - when: ansible_distribution == "Ubuntu" - -- name: debian | adding glusterfs apt repo key - apt_key: - url: "{{ glusterfs_debian_repo_info.key_url }}" - state: present - when: ansible_distribution == "Debian" - -- name: debian | adding glusterfs apt repo key - apt_key: - keyserver: "{{ glusterfs_ubuntu_repo_info.keyserver }}" - id: "{{ glusterfs_ubuntu_repo_info.id }}" - state: present - when: ansible_distribution == "Ubuntu" - -- name: debian | adding glusterfs apt repo - apt_repository: - repo: '{{ glusterfs_ubuntu_repo_info.repo }}' - state: present - when: ansible_distribution == "Ubuntu" - -- name: debian | adding glusterfs apt repo - apt_repository: - repo: '{{ glusterfs_debian_repo_info.repo }}' - state: present - when: ansible_distribution == "Debian" - -- name: debian | installing glusterfs server - apt: - name: "glusterfs-server" - state: present - when: > - inventory_hostname in groups[glusterfs_server_group] or - (groups[glusterfs_arbiter_group] is defined and - inventory_hostname in groups[glusterfs_arbiter_group]) - -- name: debian | installing glusterfs client - apt: - name: "glusterfs-client" - state: present - when: > - groups[glusterfs_client_group] is defined and - inventory_hostname in groups[glusterfs_client_group] - -- name: debian | starting GlusterFS - service: - name: "glusterfs-server" - state: started - enabled: yes - when: > - inventory_hostname in groups[glusterfs_server_group] or - (groups[glusterfs_arbiter_group] is defined and - inventory_hostname in groups[glusterfs_arbiter_group]) diff --git a/roles/ansible-glusterfs/tasks/main.yml b/roles/ansible-glusterfs/tasks/main.yml deleted file mode 100644 index f9bcebe..0000000 --- a/roles/ansible-glusterfs/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# tasks file for ansible-glusterfs -- include: config_lvm.yml - when: > - (glusterfs_config_lvm is defined and - glusterfs_config_lvm) and - (inventory_hostname in groups[glusterfs_server_group] or - inventory_hostname in groups[glusterfs_arbiter_group]) - -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: config_glusterfs_server.yml - when: > - inventory_hostname in groups[glusterfs_server_group] and - config_glusterfs - -- include: config_glusterfs_client.yml - when: > - inventory_hostname in groups[glusterfs_client_group] and - config_glusterfs - -- include: manage_arbiter_nodes.yml - when: glusterfs_manage_arbiter_nodes - -- include: resize_lvm.yml - tags: - - glusterfs-resize-lvm - when: > - glusterfs_resize_lvm is defined and - glusterfs_resize_lvm diff --git a/roles/ansible-glusterfs/tasks/manage_arbiter_nodes.yml b/roles/ansible-glusterfs/tasks/manage_arbiter_nodes.yml deleted file mode 100644 index 9fdf811..0000000 --- a/roles/ansible-glusterfs/tasks/manage_arbiter_nodes.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: manage_arbiter_nodes | joining arbiter node - shell: gluster peer probe {{ item }} - register: gluster_peer_probe - changed_when: "'already in peer list' not in gluster_peer_probe.stdout" - ignore_errors: true #added temporarily to get around Vagrant testing...may remove later - delegate_to: "{{ glusterfs_server_master }}" - with_items: '{{ groups[glusterfs_arbiter_group] }}' - -- name: manage_arbiter_nodes | creating arbiter brick mount (Only Meta-Data is stored) ##This brick only contains meta-data for volumes - file: - path: "{{ glusterfs_brick_dir }}" - owner: root - group: root - state: directory - when: inventory_hostname in groups[glusterfs_arbiter_group] diff --git a/roles/ansible-glusterfs/tasks/redhat.yml b/roles/ansible-glusterfs/tasks/redhat.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/ansible-glusterfs/tasks/redhat.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/ansible-glusterfs/tasks/resize_lvm.yml b/roles/ansible-glusterfs/tasks/resize_lvm.yml deleted file mode 100644 index 9c41e86..0000000 --- a/roles/ansible-glusterfs/tasks/resize_lvm.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: resize_lvm | rescanning iSCSI (if using) - shell: "iscsiadm -m node -R" - changed_when: false - when: glusterfs_iscsi_lvm - -- name: resize_lvm | rescanning for new disks - command: /sbin/rescan-scsi-bus - changed_when: false - when: ansible_os_family == "Debian" - -- name: resize_lvm | rescanning for new disks - command: /usr/bin/rescan-scsi-bus.sh - changed_when: false - when: ansible_os_family == "RedHat" - -- name: resize_lvm | increasing LVM volume group - lvg: - vg: "{{ item.vgname }}" - pvs: "{{ item.disks|join(',') }}" - state: present - with_items: '{{ glusterfs_lvm_vols }}' - - -- name: resize_lvm | increasing LVM logical volume - lvol: - vg: "{{ item.vgname }}" - lv: "{{ item.lvname }}" - size: "{{ glusterfs_resize_lvm_size }}" - with_items: '{{ glusterfs_lvm_vols }}' - -- name: resize_lvm | resizing LVM volumes - filesystem: - fstype: "{{ item.filesystem }}" - dev: "/dev/{{ item.vgname }}/{{ item.lvname }}" - resizefs: yes #requires Ansible 2.0+ - with_items: '{{ glusterfs_lvm_vols }}' diff --git a/roles/ansible-glusterfs/templates/etc/init/mounting-glusterfs.conf.j2 b/roles/ansible-glusterfs/templates/etc/init/mounting-glusterfs.conf.j2 deleted file mode 100644 index 871c987..0000000 --- a/roles/ansible-glusterfs/templates/etc/init/mounting-glusterfs.conf.j2 +++ /dev/null @@ -1,8 +0,0 @@ -description "Block the mounting event for glusterfs filesystems until the network interfaces are running" - -instance $MOUNTPOINT - -start on mounting TYPE=glusterfs -task -#exec start wait-for-state WAIT_FOR=static-network-up WAITER=mounting-glusterfs-$MOUNTPOINT -exec start wait-for-state WAIT_FOR=networking WAITER=mounting-glusterfs-$MOUNTPOINT diff --git a/roles/ansible-glusterfs/vars/main.yml b/roles/ansible-glusterfs/vars/main.yml deleted file mode 100644 index 75d6647..0000000 --- a/roles/ansible-glusterfs/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-glusterfs diff --git a/roles/ansible-isc-dhcp b/roles/ansible-isc-dhcp new file mode 160000 index 0000000..e738271 --- /dev/null +++ b/roles/ansible-isc-dhcp @@ -0,0 +1 @@ +Subproject commit e738271de7c2422f5068537aa6df5ad90e3bd8b7 diff --git a/roles/ansible-isc-dhcp/.travis.yml b/roles/ansible-isc-dhcp/.travis.yml deleted file mode 100644 index 00eac3a..0000000 --- a/roles/ansible-isc-dhcp/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -language: python -python: "2.7" - -env: - - SITE=test.yml - -before_install: - - sudo apt-get update -qq - - sudo apt-get install -y curl - -install: - # Install Ansible. - - pip install ansible - - # Add ansible.cfg to pick up roles path. - - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" - -script: - # Check the role/playbook's syntax. - - "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" - - # Run the role/playbook with ansible-playbook. - - "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo" - - # Run the role/playbook again, checking to make sure it's idempotent. - - > - ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo - | grep -q 'changed=0.*failed=0' - && (echo 'Idempotence test: pass' && exit 0) - || (echo 'Idempotence test: fail' && exit 1) - - # Make sure Ansible is installed (yes, this is contrived, since Ansible was - # already installed via pip earlier...). - - "which ansible" diff --git a/roles/ansible-isc-dhcp/LICENSE b/roles/ansible-isc-dhcp/LICENSE deleted file mode 100644 index d66364e..0000000 --- a/roles/ansible-isc-dhcp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Larry Smith Jr. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/ansible-isc-dhcp/README.md b/roles/ansible-isc-dhcp/README.md deleted file mode 100644 index 021a45d..0000000 --- a/roles/ansible-isc-dhcp/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# ansible-isc-dhcp - -An [Ansible](https://www.ansible.com) role to install/configure [ISC-DHCP](https://www.isc.org/downloads/dhcp/) server(s) - -- Configurable options -- Failover and load balancing ready - -## Requirements - -### Scopes - -Define your DHCP Scopes - -```yaml -isc_dhcp_scopes: - - subnet: 192.168.250.0 - default_lease_time: "{{ isc_dhcp_default_lease_time }}" - max_lease_time: "{{ isc_dhcp_max_lease_time }}" - netmask: 255.255.255.0 - # Define scope specific options to configure - options: - - name: routers - value: 192.168.250.1 - - name: subnet-mask - value: 255.255.255.0 - - name: broadcast-address - value: 192.168.250.255 - - name: domain-name-servers - value: "{{ isc_dhcp_name_servers|join (', ') }}" - range_start: 192.168.250.128 - range_end: 192.168.250.224 -``` - -### Failover scopes - -For failover define the following vars to fit your deployment... - -```yaml -isc_dhcp_failover_info: - # ansible_default_ipv4.address|ansible_enp0s8.ipv4.address - # Defines failover address for dhcp failover setup - failover_address: "{{ ansible_default_ipv4.address }}" - # Define Ansible inventory group that nodes belong to - failover_group: dhcp-nodes - # Define the node in which should be considered the primary - primary: "{{ groups['dhcp-nodes'][0] }}" - # Define the node in which should be considered the secondary - secondary: "{{ groups['dhcp-nodes'][1] }}" -``` - -## Role Variables - -[defaults/main.yml](defaults/main.yml) - -## Dependencies - -None - -## Example Playbook - -```yaml ---- -- hosts: dhcp-nodes - vars: - isc_dhcp_scopes: - - subnet: 192.168.250.0 - default_lease_time: "{{ isc_dhcp_default_lease_time }}" - max_lease_time: "{{ isc_dhcp_max_lease_time }}" - netmask: 255.255.255.0 - # Define scope specific options to configure - options: - - name: routers - value: 192.168.250.1 - - name: subnet-mask - value: 255.255.255.0 - - name: broadcast-address - value: 192.168.250.255 - - name: domain-name-servers - value: "{{ isc_dhcp_name_servers|join (', ') }}" - range_start: 192.168.250.128 - range_end: 192.168.250.224 - roles: - - role: ansible-isc-dhcp -``` - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) -- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) -- diff --git a/roles/ansible-isc-dhcp/defaults/main.yml b/roles/ansible-isc-dhcp/defaults/main.yml deleted file mode 100644 index 9aa5c3e..0000000 --- a/roles/ansible-isc-dhcp/defaults/main.yml +++ /dev/null @@ -1,114 +0,0 @@ ---- -# defaults file for ansible-isc-dhcp - -# Defines if DHCP server should be authoritative for subnet -isc_dhcp_authoritative: false - -# Defines if dhcp should be configured -isc_dhcp_config_dhcp: false - -# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf) -isc_dhcp_dhcpd_conf: /etc/dhcp/dhcpd.conf - -# Defines if ddns updates should be enabled between dhcp and dns -isc_dhcp_ddns_updates: false - -# Defines ddns update style -# options are ad-hoc, interim, standard or none -# read more on this here -# https://deepthought.isc.org/article/AA-01091/0/ISC-DHCP-support-for-Standard-DDNS.html -isc_dhcp_ddns_update_style: none - -isc_dhcp_default_lease_time: 86400 - -# Define forward zones to forward to -isc_dhcp_dns_fwd_zones: [] - # #define forward zone name - # - zone: "{{ isc_dhcp_domain_name }}" - # #define forward zone primary dns server to forward to - # primary: 127.0.0.1 - -isc_dhcp_dns_rev_zones: [] - # #define reverse zone - # - zone: 250.168.192 - # #define reverse zone primary dns server to forward to - # primary: 127.0.0.1 - -# Defines domain name to assign to dhcp clients -isc_dhcp_domain_name: "{{ isc_dhcp_pri_domain_name }}" - -# Defines if dhcp load balancing and failover should be configured -# between dhcp servers -isc_dhcp_enable_dhcp_failover: false - -# Defines if TFTP/PXE boot options should be enabled -isc_dhcp_enable_pxe_boot: false - -isc_dhcp_failover_info: [] - # # ansible_default_ipv4.address|ansible_enp0s8.ipv4.address - # # Defines failover address for dhcp failover setup - # failover_address: "{{ ansible_default_ipv4.address }}" - # # Define Ansible inventory group that nodes belong to - # failover_group: dhcp-nodes - # # Define the node in which should be considered the primary - # primary: "{{ groups['dhcp-nodes'][0] }}" - # # Define the node in which should be considered the secondary - # secondary: "{{ groups['dhcp-nodes'][1] }}" - -# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? -isc_dhcp_listen_interfaces: [] - # - enp0s8 - # - eth0 - # - eth1 - -# Defines max lease time for clients -isc_dhcp_max_lease_time: 86400 - -# Defines dns servers to assign to dhcp clients -isc_dhcp_name_servers: - - 8.8.8.8 - - 8.8.4.4 - -# Defines ntp servers for clients to poll -isc_dhcp_ntp_servers: -# - "ntp1.{{ isc_dhcp_pri_domain_name }}" -# - "ntp2.{{ isc_dhcp_pri_domain_name }}" - - 0.ubuntu.pool.ntp.org - - 1.ubuntu.pool.ntp.org - -# Define global options to configure -isc_dhcp_options: [] - # - name: domain-name - # value: '"{{ isc_dhcp_domain_name }}"' - # - name: domain-name-servers - # value: "{{ isc_dhcp_name_servers|join (', ') }}" - # - name: ntp-servers - # value: "{{ isc_dhcp_ntp_servers|join (', ') }}" - -# Defines boot file used for pxe boot -isc_dhcp_pxe_boot_file: pxelinux.0 - -# Defines tftp server to PXE/TFTP from -isc_dhcp_pxe_boot_server: "tftp.{{ isc_dhcp_pri_domain_name }}" - -# Defines dhcp scopes to create -isc_dhcp_scopes: [] - # - subnet: 192.168.250.0 - # default_lease_time: "{{ isc_dhcp_default_lease_time }}" - # max_lease_time: "{{ isc_dhcp_max_lease_time }}" - # netmask: 255.255.255.0 - # # Define scope specific options to configure - # options: - # - name: routers - # value: 192.168.250.1 - # - name: subnet-mask - # value: 255.255.255.0 - # - name: broadcast-address - # value: 192.168.250.255 - # - name: domain-name-servers - # value: "{{ isc_dhcp_name_servers|join (', ') }}" - # range_start: 192.168.250.128 - # range_end: 192.168.250.224 - -# Defines primary domain name for environment -isc_dhcp_pri_domain_name: example.org diff --git a/roles/ansible-isc-dhcp/handlers/main.yml b/roles/ansible-isc-dhcp/handlers/main.yml deleted file mode 100644 index c1476e2..0000000 --- a/roles/ansible-isc-dhcp/handlers/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# handlers file for ansible-isc-dhcp -- name: restart debian DHCP Server - service: - name: isc-dhcp-server - state: restarted - become: true - -- name: restart redhat DHCP Server - service: - name: dhcpd - state: restarted - become: true diff --git a/roles/ansible-isc-dhcp/meta/.galaxy_install_info b/roles/ansible-isc-dhcp/meta/.galaxy_install_info deleted file mode 100644 index 6cb8a18..0000000 --- a/roles/ansible-isc-dhcp/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:47 2018', version: ''} diff --git a/roles/ansible-isc-dhcp/meta/main.yml b/roles/ansible-isc-dhcp/meta/main.yml deleted file mode 100644 index 3de96fc..0000000 --- a/roles/ansible-isc-dhcp/meta/main.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An Ansible role to install/configure isc-dhcp server(s) https://www.isc.org/downloads/dhcp/ (Configurable options...failover and load balancing ready) - - license: MIT - min_ansible_version: 1.2 - - platforms: - - name: EL - versions: - - 7 - - name: Ubuntu - versions: - - precise - - trusty - - xenial - - name: Debian - versions: - - jessie - - categories: - - networking - - system -dependencies: [] diff --git a/roles/ansible-isc-dhcp/tasks/config.yml b/roles/ansible-isc-dhcp/tasks/config.yml deleted file mode 100644 index 890094f..0000000 --- a/roles/ansible-isc-dhcp/tasks/config.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: config | Configuring DHCP Defaults - template: - src: etc/default/isc-dhcp-server.j2 - dest: /etc/default/isc-dhcp-server - owner: root - group: root - mode: "u=rw,g=r,o=r" - become: true - notify: restart {{ ansible_os_family|lower }} DHCP Server - when: ansible_os_family == "Debian" - -- name: config | Configuring DHCP Service - template: - src: etc/dhcp/dhcpd.conf.j2 - dest: /etc/dhcp/dhcpd.conf - owner: root - group: root - mode: "u=rw,g=r,o=r" - become: true - notify: restart {{ ansible_os_family|lower }} DHCP Server diff --git a/roles/ansible-isc-dhcp/tasks/debian.yml b/roles/ansible-isc-dhcp/tasks/debian.yml deleted file mode 100644 index 50eee90..0000000 --- a/roles/ansible-isc-dhcp/tasks/debian.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: debian | Installing DHCP Packages - apt: - name: isc-dhcp-server - state: present - become: true diff --git a/roles/ansible-isc-dhcp/tasks/main.yml b/roles/ansible-isc-dhcp/tasks/main.yml deleted file mode 100644 index 1122ba2..0000000 --- a/roles/ansible-isc-dhcp/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# tasks file for ansible-isc-dhcp -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: config.yml - when: isc_dhcp_config_dhcp diff --git a/roles/ansible-isc-dhcp/tasks/redhat.yml b/roles/ansible-isc-dhcp/tasks/redhat.yml deleted file mode 100644 index 7751cff..0000000 --- a/roles/ansible-isc-dhcp/tasks/redhat.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: redhat | Installing DHCP Packages - yum: - name: dhcp - state: present - become: true - when: ansible_distribution != "Fedora" - -- name: redhat | Ensuring DHCP Service is Enabled - service: - name: dhcpd - enabled: true - become: true diff --git a/roles/ansible-isc-dhcp/templates/etc/default/isc-dhcp-server.j2 b/roles/ansible-isc-dhcp/templates/etc/default/isc-dhcp-server.j2 deleted file mode 100644 index a42e33a..0000000 --- a/roles/ansible-isc-dhcp/templates/etc/default/isc-dhcp-server.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{{ ansible_managed|comment }} - -DHCPD_CONF={{ isc_dhcp_dhcpd_conf }} - -INTERFACES="{{ isc_dhcp_listen_interfaces|join(' ') }}" diff --git a/roles/ansible-isc-dhcp/templates/etc/dhcp/dhcpd.conf.j2 b/roles/ansible-isc-dhcp/templates/etc/dhcp/dhcpd.conf.j2 deleted file mode 100644 index 0445e85..0000000 --- a/roles/ansible-isc-dhcp/templates/etc/dhcp/dhcpd.conf.j2 +++ /dev/null @@ -1,97 +0,0 @@ -{{ ansible_managed|comment }} - -{% if isc_dhcp_ddns_updates %} -ddns-updates on; -ddns-update-style {{ isc_dhcp_ddns_update_style|lower }}; -update-static-leases on; -allow unknown-clients; -use-host-decl-names on; -{% elif not isc_dhcp_ddns_updates %} -ddns-update-style none; -{% endif %} - -{% for item in isc_dhcp_options %} -option {{ item.name }} {{ item.value }}; -{% endfor %} - -default-lease-time 600; -max-lease-time 7200; - -{% if isc_dhcp_authoritative %} -authoritative; -{% endif %} - -log-facility local7; - -{% if isc_dhcp_enable_dhcp_failover %} -{% if inventory_hostname == isc_dhcp_failover_info.primary %} -failover peer "failover" { - primary; - address {{ isc_dhcp_failover_info.failover_address }}; - port 519; -{% for host in groups[isc_dhcp_failover_info.failover_group] %} -{% if inventory_hostname != host %} - peer address {{ host }}; -{% endif %} -{% endfor %} - peer port 520; - mclt 3600; - split 128; - load balance max seconds 3; -} -{% endif %} - -{% if inventory_hostname == isc_dhcp_failover_info.secondary %} -failover peer "failover" { - secondary; - address {{ isc_dhcp_failover_info.failover_address }}; - port 520; -{% for host in groups[isc_dhcp_failover_info.failover_group] %} -{% if inventory_hostname != host %} - peer address {{ host }}; -{% endif %} -{% endfor %} - peer port 519; - load balance max seconds 3; -} -{% endif %} -{% endif %} - -{% if isc_dhcp_scopes is defined %} -{% for item in isc_dhcp_scopes %} -subnet {{ item.subnet }} netmask {{ item.netmask }} { - pool { -{% if isc_dhcp_enable_dhcp_failover %} - failover peer "failover"; -{% endif %} - range {{ item.range_start }} {{ item.range_end }}; - } -{% for option in item.options %} - option {{ option.name }} {{ option.value }}; -{% endfor %} -{% if isc_dhcp_enable_pxe_boot %} - option bootfile-name "{{ isc_dhcp_pxe_boot_file }}"; - next-server {{ isc_dhcp_pxe_boot_server }}; -{% endif %} - - default-lease-time {{ item.default_lease_time }}; - max-lease-time {{ item.max_lease_time }}; -} -{% endfor %} -{% endif %} - -{% if isc_dhcp_dns_fwd_zones is defined %} -{% for item in isc_dhcp_dns_fwd_zones %} -zone {{ item.zone }}. { - primary {{ item.primary }}; -} -{% endfor %} -{% endif %} - -{% if isc_dhcp_dns_rev_zones is defined %} -{% for item in isc_dhcp_dns_rev_zones %} -zone {{ item.zone }}.in-addr.arpa. { - primary {{ item.primary }}; -} -{% endfor %} -{% endif %} diff --git a/roles/ansible-isc-dhcp/tests/group_vars/all/isc-dhcp.yml b/roles/ansible-isc-dhcp/tests/group_vars/all/isc-dhcp.yml deleted file mode 100644 index c97e594..0000000 --- a/roles/ansible-isc-dhcp/tests/group_vars/all/isc-dhcp.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -dhcp_dns_fwd_zones: #isc-dhcp - - dhcp_dns_fwd_zone: '{{ dhcp_domain_name }}' - dhcp_dns_primary: '{{ dhcp_dns_primary }}' -dhcp_dns_primary: 127.0.0.1 -dhcp_dns_rev_zones: #isc-dhcp - - dhcp_dns_rev_zone: 0.0.10 - dhcp_dns_primary: '{{ dhcp_dns_primary }}' - - dhcp_dns_rev_zone: 101.0.10 - dhcp_dns_primary: '{{ dhcp_dns_primary }}' - - dhcp_dns_rev_zone: 125.0.10 - dhcp_dns_primary: '{{ dhcp_dns_primary }}' -dhcp_scopes: #defines dhcp scopes to create...define here or in group_vars/group - - dhcp_range: '10.0.0.128 10.0.0.224' - dhcp_subnet: 10.0.0.0 - dhcp_netmask: 255.255.255.0 - dhcp_routers: 10.0.0.1 - dhcp_subnet_mask: 255.255.255.0 - dhcp_broadcast_address: 10.0.0.255 - dhcp_domain_name_servers: '{{ dhcp_name_servers }}' - dhcp_default_lease_time: '{{ default_lease_time }}' - dhcp_max_lease_time: '{{ isc_dhcp_max_lease_time }}' - - dhcp_range: '10.0.101.128 10.0.101.224' - dhcp_subnet: 10.0.101.0 - dhcp_netmask: 255.255.255.0 - dhcp_routers: 10.0.101.1 - dhcp_subnet_mask: 255.255.255.0 - dhcp_broadcast_address: 10.0.101.255 - dhcp_domain_name_servers: '{{ dhcp_name_servers }}' - dhcp_default_lease_time: '{{ default_lease_time }}' - dhcp_max_lease_time: '{{ isc_dhcp_max_lease_time }}' -pxe_boot_server: 192.168.240.100 #defines tftp server to PXE/TFTP from......define here or in group_vars/group diff --git a/roles/ansible-isc-dhcp/tests/inventory b/roles/ansible-isc-dhcp/tests/inventory deleted file mode 100644 index 2fbb50c..0000000 --- a/roles/ansible-isc-dhcp/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/ansible-isc-dhcp/tests/test.yml b/roles/ansible-isc-dhcp/tests/test.yml deleted file mode 100644 index 9132fb5..0000000 --- a/roles/ansible-isc-dhcp/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-isc-dhcp diff --git a/roles/ansible-isc-dhcp/vars/main.yml b/roles/ansible-isc-dhcp/vars/main.yml deleted file mode 100644 index 7458d92..0000000 --- a/roles/ansible-isc-dhcp/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-isc-dhcp diff --git a/roles/ansible-k8s b/roles/ansible-k8s new file mode 160000 index 0000000..9a6eb80 --- /dev/null +++ b/roles/ansible-k8s @@ -0,0 +1 @@ +Subproject commit 9a6eb80936100cdcf7219c4b22966147efebba22 diff --git a/roles/ansible-k8s/LICENSE b/roles/ansible-k8s/LICENSE deleted file mode 100644 index 120bed5..0000000 --- a/roles/ansible-k8s/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Larry Smith Jr. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/ansible-k8s/README.md b/roles/ansible-k8s/README.md deleted file mode 100644 index 73701c4..0000000 --- a/roles/ansible-k8s/README.md +++ /dev/null @@ -1,399 +0,0 @@ - - - - -**Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_ - -- [ansible-k8s](#ansible-k8s) - - [Requirements](#requirements) - - [Role Variables](#role-variables) - - [Dependencies](#dependencies) - - [Example Playbook](#example-playbook) - - [Vagrant](#vagrant) - - [Additional Info](#additional-info) - - [Reset `K8s` cluster](#reset-k8s-cluster) - - [Get a list of pods and information on them](#get-a-list-of-pods-and-information-on-them) - - [Kubernetes-Dashboard](#kubernetes-dashboard) - - [Find the port to connect to](#find-the-port-to-connect-to) - - [Inspect the service](#inspect-the-service) - - [License](#license) - - [Author Information](#author-information) - - - -# ansible-k8s - -An [Ansible](https://www.ansible.com) role to deploy a -[Kubernetes](https://kubernetes.io) - K8s Cluster - -- [Weave-Net](https://www.weave.works/docs/net/latest/kube-addon/) is used for - the network overlay currently - -## Requirements - -Install additional required [Ansible](https://www.ansible.com) roles: - -```bash -sudo ansible-galaxy install -r requirements.yml -``` - -## Role Variables - -[defaults/main.yml](defaults/main.yml) - -## Dependencies - -None - -## Example Playbook - -```yaml ---- -- hosts: k8s - # become: true - vars: - # Define Docker version to install - docker_version: '1.12.6' - # Defines if all nodes in play should be added to each hosts /etc/hosts - etc_hosts_add_all_hosts: true - etc_hosts_pri_dns_name: '{{ pri_domain_name }}' - # Defines if node has static IP. - etc_hosts_static_ip: true - # Defines if ansible_default_ipv4.address is used for defining hosts - etc_hosts_use_default_ip_address: false - # Defines if ansible_ssh_host is used for defining hosts - etc_hosts_use_ansible_ssh_host: true - pri_domain_name: 'test.vagrant.local' - roles: - - role: ansible-etc-hosts - - role: ansible-change-hostname - - role: ansible-docker - - role: ansible-k8s - tasks: -``` - -## Vagrant - -- Requirements - - [Ansible](https://www.ansible.com) - - [Vagrant](https://www.vagrantup.com/) - - [Virtualbox](https://www.virtualbox.org/) - -Included in the `Vagrant` folder is a testing environment with `3` nodes. - -- `node0` - K8s Cluster Master (`192.168.250.10`) -- `node1` - K8s Cluster Member (`192.168.250.11`) -- `node2` - K8s Cluster Member (`192.168.250.12`) - -You can easily spin this up for learning purposes: - -```bash -cd Vagrant/ -vagrant up -``` - -Once the environment spins up you will see the following: - -```bash -TASK [ansible-k8s : cluster_summary | Displaying Cluster Nodes] **************** -skipping: [node1] -ok: [node0] => { - "_k8s_cluster_nodes['stdout_lines']": [ - "NAME STATUS AGE VERSION", - "node0 Ready 1m v1.6.1", - "node1 NotReady 4s v1.6.1", - "node2 NotReady 6s v1.6.1" - ], - "changed": false -} -skipping: [node2] -``` - -Do not worry about the above as the additional nodes did not completely join -the cluster before the provisioning completed. You can quickly validate that -the additional nodes are up and `Ready` by running: - -```bash -ansible-playbook -i hosts playbook.yml --tags k8s_cluster_nodes -``` - -The above `NotReady` should no longer be an issue as we now wait for all nodes -in the cluster to become `Ready`. However, there may be an instance where this -may not work as expected. - -```bash -TASK [ansible-k8s : cluster_summary | Displaying Cluster Nodes] ****************************************************************************************************************** -skipping: [node1] -skipping: [node2] -ok: [node0] => { - "_k8s_cluster_nodes['stdout_lines']": [ - "NAME STATUS ROLES AGE VERSION", - "node0 Ready master 3m v1.9.0", - "node1 Ready 2m v1.9.0", - "node2 Ready 2m v1.9.0" - ] -} -``` - -Once the cluster is up `ssh` to `node0` and begin playing: - -```bash -vagrant ssh node0 -``` - -When you are all done using the environment easily tear it down: - -```bash -./cleanup.sh - -==> node2: Forcing shutdown of VM... -==> node2: Destroying VM and associated drives... -==> node1: Forcing shutdown of VM... -==> node1: Destroying VM and associated drives... -==> node0: Forcing shutdown of VM... -==> node0: Destroying VM and associated drives... -``` - -## Additional Info - -### Reset `K8s` cluster - -```bash -ansible-playbook -i hosts playbook.yml --tags k8s_reset -e "k8s_reset_cluster=true" -``` - -### Get a list of pods and information on them - -```bash -ansible-playbook -i hosts playbook.yml --tags k8s_pods -``` - -```json -{ - "containers": [ - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/etcd-amd64:3.1.10", - "name": "etcd", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": {} - }, - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/kube-apiserver-amd64:v1.9.0", - "name": "kube-apiserver", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": { - "requests": { - "cpu": "250m" - } - } - }, - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/kube-controller-manager-amd64:v1.9.0", - "name": "kube-controller-manager", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": { - "requests": { - "cpu": "200m" - } - } - }, - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7", - "name": "kubedns", - "nodeName": "node0", - "phase": "Running", - "podIP": "10.32.0.2", - "resources": { - "limits": { - "memory": "170Mi" - }, - "requests": { - "cpu": "100m", - "memory": "70Mi" - } - } - }, - { - "hostIP": "192.168.250.12", - "image": "gcr.io/google_containers/kube-proxy-amd64:v1.9.0", - "name": "kube-proxy", - "nodeName": "node2", - "phase": "Running", - "podIP": "192.168.250.12", - "resources": {} - }, - { - "hostIP": "192.168.250.11", - "image": "gcr.io/google_containers/kube-proxy-amd64:v1.9.0", - "name": "kube-proxy", - "nodeName": "node1", - "phase": "Running", - "podIP": "192.168.250.11", - "resources": {} - }, - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/kube-proxy-amd64:v1.9.0", - "name": "kube-proxy", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": {} - }, - { - "hostIP": "192.168.250.10", - "image": "gcr.io/google_containers/kube-scheduler-amd64:v1.9.0", - "name": "kube-scheduler", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": { - "requests": { - "cpu": "100m" - } - } - }, - { - "hostIP": "192.168.250.12", - "image": "k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.1", - "name": "kubernetes-dashboard", - "nodeName": "node2", - "phase": "Running", - "podIP": "10.36.0.1", - "resources": {} - }, - { - "hostIP": "192.168.250.10", - "image": "weaveworks/weave-kube:2.1.3", - "name": "weave", - "nodeName": "node0", - "phase": "Running", - "podIP": "192.168.250.10", - "resources": { - "requests": { - "cpu": "10m" - } - } - }, - { - "hostIP": "192.168.250.11", - "image": "weaveworks/weave-kube:2.1.3", - "name": "weave", - "nodeName": "node1", - "phase": "Running", - "podIP": "192.168.250.11", - "resources": { - "requests": { - "cpu": "10m" - } - } - }, - { - "hostIP": "192.168.250.12", - "image": "weaveworks/weave-kube:2.1.3", - "name": "weave", - "nodeName": "node2", - "phase": "Running", - "podIP": "192.168.250.12", - "resources": { - "requests": { - "cpu": "10m" - } - } - } - ] - } -} -``` - -### [Kubernetes-Dashboard](https://github.com/kubernetes/dashboard) - -The [Kubernetes-Dashboard](https://github.com/kubernetes/dashboard) is installed -during the install and available for usage. In order to find out where/how to -connect to the dashboard seems to involve the following. - -### Find the port to connect to - -```bash -vagrant ssh node0 - -kubectl get services --all-namespaces -... -NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -default kubernetes ClusterIP 10.96.0.1 443/TCP 6m -kube-system kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP 6m -kube-system kubernetes-dashboard ClusterIP 10.97.72.90 443/TCP 4m -``` - -We can see the port is `80:32285` from above. - -> NOTE: The above only works for later versions of the dashboard. Reference the -> [Accessing-Dashboard#nodeport](https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above#nodeport) for more info on doing this as of later versions. -> -> INFO: This way of accessing Dashboard is only recommended for development environments in a single node setup. - -### Inspect the service - -```bash -kubectl describe services kubernetes-dashboard --namespace=kube-system -... -Name: kubernetes-dashboard -Namespace: kube-system -Labels: k8s-app=kubernetes-dashboard -Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"k8s-app":"kubernetes-dashboard"},"name":"kubernetes-dashboard","namespace":... -Selector: k8s-app=kubernetes-dashboard -Type: ClusterIP -IP: 10.97.72.90 -Port: 443/TCP -TargetPort: 8443/TCP -Endpoints: 10.36.0.1:8443 -Session Affinity: None -Events: -``` - -You can then connect to [Dashboard](https://192.168.250.10:32285) for this example. - -> NOTE: In order to login using a token reference the following [link](https://github.com/kubernetes/dashboard/wiki/Access-control#bearer-token) -> -> NOTE: To login with admin privileges reference the following [link](https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges) - -The `32285` port changes every new deployment of the dashboard so you will -need to discover what that new port is. Or you can run the following to report -on the usable link: - -```bash -ansible-playbook -i hosts playbook.yml --tags k8s_get_dashboard -``` - -Which will result in the following after the play finishes: - -```bash -TASK [ansible-k8s : reports | Dashboard] *************************************** -skipping: [node1] -skipping: [node2] -ok: [node0] => { - "msg": "Kubernetes Dashboard Can be reached at: http://192.168.250.10:30467\n" -} -``` - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) -- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) -- diff --git a/roles/ansible-k8s/Vagrant/.gitignore b/roles/ansible-k8s/Vagrant/.gitignore deleted file mode 100644 index 3ceac22..0000000 --- a/roles/ansible-k8s/Vagrant/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.retry -.vagrant/ -ubuntu-yakkety-16.10-cloudimg-console.log -ubuntu-xenial-16.04-cloudimg-console.log -ubuntu-zesty-17.04-cloudimg-console.log diff --git a/roles/ansible-k8s/Vagrant/Vagrantfile b/roles/ansible-k8s/Vagrant/Vagrantfile deleted file mode 100644 index c067b12..0000000 --- a/roles/ansible-k8s/Vagrant/Vagrantfile +++ /dev/null @@ -1,170 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. - -# Ensure yaml module is loaded -require 'yaml' - -# Read yaml node definitions to create -# **Update nodes.yml to reflect any changes -nodes = YAML.load_file(File.join(File.dirname(__FILE__), 'nodes.yml')) - -# Define global variables -# - -Vagrant.configure(2) do |config| - # Iterate over nodes to get a count - # Define as 0 for counting the number of nodes to create from nodes.yml - groups = [] # Define array to hold ansible groups - num_nodes = 0 - populated_ansible_groups = Hash.new # Create hash to contain iterated groups - - # Create array of Ansible Groups from iterated nodes - nodes.each do |node| - num_nodes = node - node['ansible_groups'].each do |group| - groups.push(group) - end - end - - # Remove duplicate Ansible Groups - groups = groups.uniq - - # Iterate through array of Ansible Groups - groups.each do |group| - group_nodes = [] - # Iterate list of nodes - nodes.each do |node| - node['ansible_groups'].each do |nodegroup| - # Check if node is a member of iterated group - if nodegroup == group - group_nodes.push(node['name']) - end - end - populated_ansible_groups[group] = group_nodes - end - end - - # Dynamic Ansible Groups iterated from nodes.yml - ansible_groups = populated_ansible_groups - - # Define Ansible groups statically for more control - # ansible_groups = { - # "spines" => ["node0", "node7"], - # "leafs" => ["node[1:2]", "node[8:9]"], - # "quagga-routers:children" => ["spines", "leafs", "compute-nodes"], - # "compute-nodes" => ["node[3:6]"], - # "docker-swarm:children" => ["docker-swarm-managers", "docker-swarm-workers"], - # "docker-swarm-managers" => ["node[3:4]"], - # "docker-swarm-workers" => ["node[5:6]"] - # } - - #Iterate over nodes - nodes.each do |node_id| - # Below is needed if not using Guest Additions - # config.vm.synced_folder ".", "/vagrant", type: "rsync", - # rsync__exclude: "hosts" - config.vm.define node_id['name'] do |node| - node.vm.box = node_id['box'] - node.vm.hostname = node_id['name'] - node.vm.provider "virtualbox" do |vb| - vb.memory = node_id['mem'] - vb.cpus = node_id['vcpu'] - - # Setup desktop environment - if not node_id['desktop'].nil? - if node_id['desktop'] - vb.gui = true - vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"] - vb.customize ["modifyvm", :id, "--accelerate3d", "on"] - vb.customize ["modifyvm", :id, "--ioapic", "on"] - vb.customize ["modifyvm", :id, "--vram", "128"] - vb.customize ["modifyvm", :id, "--hwvirtex", "on"] - end - end - - # Add additional disk(s) - if not node_id['disks'].nil? - dnum = 0 - node_id['disks'].each do |disk_num| - dnum = (dnum.to_i + 1) - ddev = ("#{node_id['name']}_Disk#{dnum}.vdi") - dsize = disk_num['size'].to_i * 1024 - unless File.exist?("#{ddev}") - vb.customize ['createhd', '--filename', ("#{ddev}"), \ - '--variant', 'Fixed', '--size', dsize] - end - vb.customize ['storageattach', :id, '--storagectl', \ - "#{disk_num['controller']}", '--port', dnum, '--device', 0, \ - '--type', 'hdd', '--medium', "#{ddev}"] - end - end - end - - # Provision network interfaces - if not node_id['interfaces'].nil? - node_id['interfaces'].each do |int| - if int['method'] == 'dhcp' - if int['network_name'] == "None" - node.vm.network :private_network, \ - type: "dhcp" - end - if int['network_name'] != "None" - node.vm.network :private_network, \ - virtualbox__intnet: int['network_name'], \ - type: "dhcp" - end - end - if int['method'] == "static" - if int['network_name'] == "None" - node.vm.network :private_network, \ - ip: int['ip'], \ - auto_config: int['auto_config'] - end - if int['network_name'] != "None" - node.vm.network :private_network, \ - virtualbox__intnet: int['network_name'], \ - ip: int['ip'], \ - auto_config: int['auto_config'] - end - end - end - end - - # Port Forwards - if not node_id['port_forwards'].nil? - node_id['port_forwards'].each do |pf| - node.vm.network :forwarded_port, \ - guest: pf['guest'], \ - host: pf['host'] - end - end - - # Provisioners - if not node_id['provision'].nil? - if node_id['provision'] - #runs initial shell script - config.vm.provision :shell, path: "bootstrap.sh", keep_color: "true" - if node_id == num_nodes - node.vm.provision "ansible" do |ansible| - ansible.limit = "all" - #runs bootstrap Ansible playbook - ansible.playbook = "bootstrap.yml" - end - node.vm.provision "ansible" do |ansible| - ansible.limit = "all" - #runs Ansible playbook for installing roles/executing tasks - ansible.playbook = "playbook.yml" - ansible.groups = ansible_groups - end - end - end - end - end - - end -end diff --git a/roles/ansible-k8s/Vagrant/ansible.cfg b/roles/ansible-k8s/Vagrant/ansible.cfg deleted file mode 100644 index 03ac2ef..0000000 --- a/roles/ansible-k8s/Vagrant/ansible.cfg +++ /dev/null @@ -1,383 +0,0 @@ -# config file for ansible -- http://ansible.com/ -# ============================================== - -# nearly all parameters can be overridden in ansible-playbook -# or with command line flags. ansible will read ANSIBLE_CONFIG, -# ansible.cfg in the current working directory, .ansible.cfg in -# the home directory or /etc/ansible/ansible.cfg, whichever it -# finds first - -[defaults] - -# some basic default values... - -#inventory = /etc/ansible/hosts -#library = /usr/share/my_modules/ -#remote_tmp = ~/.ansible/tmp -#local_tmp = ~/.ansible/tmp -#forks = 5 -#poll_interval = 15 -#sudo_user = root -#ask_sudo_pass = True -#ask_pass = True -#transport = smart -#remote_port = 22 -#module_lang = C -#module_set_locale = False - -# plays will gather facts by default, which contain information about -# the remote system. -# -# smart - gather by default, but don't regather if already gathered -# implicit - gather by default, turn off with gather_facts: False -# explicit - do not gather by default, must say gather_facts: True -#gathering = implicit - -# This only affects the gathering done by a play's gather_facts directive, -# by default gathering retrieves all facts subsets -# all - gather all subsets -# network - gather min and network facts -# hardware - gather hardware facts (longest facts to retrieve) -# virtual - gather min and virtual facts -# facter - import facts from facter -# ohai - import facts from ohai -# You can combine them using comma (ex: network,virtual) -# You can negate them using ! (ex: !hardware,!facter,!ohai) -# A minimal set of facts is always gathered. -#gather_subset = all - -# some hardware related facts are collected -# with a maximum timeout of 10 seconds. This -# option lets you increase or decrease that -# timeout to something more suitable for the -# environment. -# gather_timeout = 10 - -# additional paths to search for roles in, colon separated -#roles_path = /etc/ansible/roles -roles_path = ~/Git_Projects/GitHub/mrlesmithjr:roles - -# uncomment this to disable SSH key host checking -host_key_checking = False - -# change the default callback -#stdout_callback = skippy -# enable additional callbacks -#callback_whitelist = log_plays - -# Determine whether includes in tasks and handlers are "static" by -# default. As of 2.0, includes are dynamic by default. Setting these -# values to True will make includes behave more like they did in the -# 1.x versions. -#task_includes_static = True -#handler_includes_static = True - -# Controls if a missing handler for a notification event is an error or a warning -#error_on_missing_handler = True - -# change this for alternative sudo implementations -#sudo_exe = sudo - -# What flags to pass to sudo -# WARNING: leaving out the defaults might create unexpected behaviours -#sudo_flags = -H -S -n - -# SSH timeout -#timeout = 10 - -# default user to use for playbooks if user is not specified -# (/usr/bin/ansible will use current user as default) -#remote_user = root - -# logging is off by default unless this path is defined -# if so defined, consider logrotate -#log_path = /var/log/ansible.log - -# default module name for /usr/bin/ansible -#module_name = command - -# use this shell for commands executed under sudo -# you may need to change this to bin/bash in rare instances -# if sudo is constrained -#executable = /bin/sh - -# if inventory variables overlap, does the higher precedence one win -# or are hash values merged together? The default is 'replace' but -# this can also be set to 'merge'. -#hash_behaviour = replace - -# by default, variables from roles will be visible in the global variable -# scope. To prevent this, the following option can be enabled, and only -# tasks and handlers within the role will see the variables there -#private_role_vars = yes - -# list any Jinja2 extensions to enable here: -#jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n - -# if set, always use this private key file for authentication, same as -# if passing --private-key to ansible or ansible-playbook -#private_key_file = /path/to/file - -# If set, configures the path to the Vault password file as an alternative to -# specifying --vault-password-file on the command line. -#vault_password_file = /path/to/vault_password_file - -# format of string {{ ansible_managed }} available within Jinja2 -# templates indicates to users editing templates files will be replaced. -# replacing {file}, {host} and {uid} and strftime codes with proper values. -#ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host} -# {file}, {host}, {uid}, and the timestamp can all interfere with idempotence -# in some situations so the default is a static string: -ansible_managed = Ansible managed - -# by default, ansible-playbook will display "Skipping [host]" if it determines a task -# should not be run on a host. Set this to "False" if you don't want to see these "Skipping" -# messages. NOTE: the task header will still be shown regardless of whether or not the -# task is skipped. -#display_skipped_hosts = True - -# by default, if a task in a playbook does not include a name: field then -# ansible-playbook will construct a header that includes the task's action but -# not the task's args. This is a security feature because ansible cannot know -# if the *module* considers an argument to be no_log at the time that the -# header is printed. If your environment doesn't have a problem securing -# stdout from ansible-playbook (or you have manually specified no_log in your -# playbook on all of the tasks where you have secret information) then you can -# safely set this to True to get more informative messages. -#display_args_to_stdout = False - -# by default (as of 1.3), Ansible will raise errors when attempting to dereference -# Jinja2 variables that are not set in templates or action lines. Uncomment this line -# to revert the behavior to pre-1.3. -#error_on_undefined_vars = False - -# by default (as of 1.6), Ansible may display warnings based on the configuration of the -# system running ansible itself. This may include warnings about 3rd party packages or -# other conditions that should be resolved if possible. -# to disable these warnings, set the following value to False: -#system_warnings = True - -# by default (as of 1.4), Ansible may display deprecation warnings for language -# features that should no longer be used and will be removed in future versions. -# to disable these warnings, set the following value to False: -#deprecation_warnings = True - -# (as of 1.8), Ansible can optionally warn when usage of the shell and -# command module appear to be simplified by using a default Ansible module -# instead. These warnings can be silenced by adjusting the following -# setting or adding warn=yes or warn=no to the end of the command line -# parameter string. This will for example suggest using the git module -# instead of shelling out to the git command. -# command_warnings = False - - -# set plugin path directories here, separate with colons -#action_plugins = /usr/share/ansible/plugins/action -#cache_plugins = /usr/share/ansible/plugins/cache -#callback_plugins = /usr/share/ansible/plugins/callback -#connection_plugins = /usr/share/ansible/plugins/connection -#lookup_plugins = /usr/share/ansible/plugins/lookup -#inventory_plugins = /usr/share/ansible/plugins/inventory -#vars_plugins = /usr/share/ansible/plugins/vars -#filter_plugins = /usr/share/ansible/plugins/filter -#test_plugins = /usr/share/ansible/plugins/test -#strategy_plugins = /usr/share/ansible/plugins/strategy - - -# by default, ansible will use the 'linear' strategy but you may want to try -# another one -#strategy = free - -# by default callbacks are not loaded for /bin/ansible, enable this if you -# want, for example, a notification or logging callback to also apply to -# /bin/ansible runs -#bin_ansible_callbacks = False - - -# don't like cows? that's unfortunate. -# set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1 -#nocows = 1 - -# set which cowsay stencil you'd like to use by default. When set to 'random', -# a random stencil will be selected for each task. The selection will be filtered -# against the `cow_whitelist` option below. -#cow_selection = default -#cow_selection = random - -# when using the 'random' option for cowsay, stencils will be restricted to this list. -# it should be formatted as a comma-separated list with no spaces between names. -# NOTE: line continuations here are for formatting purposes only, as the INI parser -# in python does not support them. -#cow_whitelist=bud-frogs,bunny,cheese,daemon,default,dragon,elephant-in-snake,elephant,eyes,\ -# hellokitty,kitty,luke-koala,meow,milk,moofasa,moose,ren,sheep,small,stegosaurus,\ -# stimpy,supermilker,three-eyes,turkey,turtle,tux,udder,vader-koala,vader,www - -# don't like colors either? -# set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1 -#nocolor = 1 - -# if set to a persistent type (not 'memory', for example 'redis') fact values -# from previous runs in Ansible will be stored. This may be useful when -# wanting to use, for example, IP information from one group of servers -# without having to talk to them in the same playbook run to get their -# current IP information. -#fact_caching = memory - - -# retry files -# When a playbook fails by default a .retry file will be created in ~/ -# You can disable this feature by setting retry_files_enabled to False -# and you can change the location of the files by setting retry_files_save_path - -#retry_files_enabled = False -#retry_files_save_path = ~/.ansible-retry - -# squash actions -# Ansible can optimise actions that call modules with list parameters -# when looping. Instead of calling the module once per with_ item, the -# module is called once with all items at once. Currently this only works -# under limited circumstances, and only with parameters named 'name'. -#squash_actions = apk,apt,dnf,homebrew,pacman,pkgng,yum,zypper - -# prevents logging of task data, off by default -#no_log = False - -# prevents logging of tasks, but only on the targets, data is still logged on the master/controller -#no_target_syslog = False - -# controls whether Ansible will raise an error or warning if a task has no -# choice but to create world readable temporary files to execute a module on -# the remote machine. This option is False by default for security. Users may -# turn this on to have behaviour more like Ansible prior to 2.1.x. See -# https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user -# for more secure ways to fix this than enabling this option. -#allow_world_readable_tmpfiles = False - -# controls the compression level of variables sent to -# worker processes. At the default of 0, no compression -# is used. This value must be an integer from 0 to 9. -#var_compression_level = 9 - -# controls what compression method is used for new-style ansible modules when -# they are sent to the remote system. The compression types depend on having -# support compiled into both the controller's python and the client's python. -# The names should match with the python Zipfile compression types: -# * ZIP_STORED (no compression. available everywhere) -# * ZIP_DEFLATED (uses zlib, the default) -# These values may be set per host via the ansible_module_compression inventory -# variable -#module_compression = 'ZIP_DEFLATED' - -# This controls the cutoff point (in bytes) on --diff for files -# set to 0 for unlimited (RAM may suffer!). -#max_diff_size = 1048576 - -# This controls how ansible handles multiple --tags and --skip-tags arguments -# on the CLI. If this is True then multiple arguments are merged together. If -# it is False, then the last specified argument is used and the others are ignored. -#merge_multiple_cli_flags = False - -# Controls showing custom stats at the end, off by default -#show_custom_stats = True - -[privilege_escalation] -#become=True -#become_method=sudo -#become_user=root -#become_ask_pass=False - -[paramiko_connection] - -# uncomment this line to cause the paramiko connection plugin to not record new host -# keys encountered. Increases performance on new host additions. Setting works independently of the -# host key checking setting above. -#record_host_keys=False - -# by default, Ansible requests a pseudo-terminal for commands executed under sudo. Uncomment this -# line to disable this behaviour. -#pty=False - -[ssh_connection] - -# ssh arguments to use -# Leaving off ControlPersist will result in poor performance, so use -# paramiko on older platforms rather than removing it, -C controls compression use -#ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s - -# The base directory for the ControlPath sockets. -# This is the "%(directory)s" in the control_path option -# -# Example: -# control_path_dir = /tmp/.ansible/cp -#control_path_dir = ~/.ansible/cp - -# The path to use for the ControlPath sockets. This defaults to -# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with -# very long hostnames or very long path names (caused by long user names or -# deeply nested home directories) this can exceed the character limit on -# file socket names (108 characters for most platforms). In that case, you -# may wish to shorten the string below. -# -# Example: -# control_path = %(directory)s/%%h-%%r -#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r - -# Enabling pipelining reduces the number of SSH operations required to -# execute a module on the remote server. This can result in a significant -# performance improvement when enabled, however when using "sudo:" you must -# first disable 'requiretty' in /etc/sudoers -# -# By default, this option is disabled to preserve compatibility with -# sudoers configurations that have requiretty (the default on many distros). -# -pipelining = True - -# Control the mechanism for transferring files -# * smart = try sftp and then try scp [default] -# * True = use scp only -# * False = use sftp only -#scp_if_ssh = smart - -# if False, sftp will not use batch mode to transfer files. This may cause some -# types of file transfer failures impossible to catch however, and should -# only be disabled if your sftp version has problems with batch mode -#sftp_batch_mode = False - -[accelerate] -#accelerate_port = 5099 -#accelerate_timeout = 30 -#accelerate_connect_timeout = 5.0 - -# The daemon timeout is measured in minutes. This time is measured -# from the last activity to the accelerate daemon. -#accelerate_daemon_timeout = 30 - -# If set to yes, accelerate_multi_key will allow multiple -# private keys to be uploaded to it, though each user must -# have access to the system via SSH to add a new key. The default -# is "no". -#accelerate_multi_key = yes - -[selinux] -# file systems that require special treatment when dealing with security context -# the default behaviour that copies the existing context or uses the user default -# needs to be changed to use the file system dependent context. -#special_context_filesystems=nfs,vboxsf,fuse,ramfs - -# Set this to yes to allow libvirt_lxc connections to work without SELinux. -#libvirt_lxc_noseclabel = yes - -[colors] -#highlight = white -#verbose = blue -#warn = bright purple -#error = red -#debug = dark gray -#deprecate = purple -#skip = cyan -#unreachable = red -#ok = green -#changed = yellow -#diff_add = green -#diff_remove = red -#diff_lines = cyan diff --git a/roles/ansible-k8s/Vagrant/bootstrap.sh b/roles/ansible-k8s/Vagrant/bootstrap.sh deleted file mode 100755 index 2804cf3..0000000 --- a/roles/ansible-k8s/Vagrant/bootstrap.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -if [ -f /etc/debian_version ]; then - codename="$(lsb_release -c | awk {'print $2}')" - if [[ $codename == "vivid" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "wily" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "xenial" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "yakkety" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "zesty" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi -fi -if [ -f /etc/redhat-release ]; then - if [ -f /etc/os-release ]; then - codename="$(gawk -F= '/^NAME/{print $2}' /etc/os-release)" - if [[ $codename == "Fedora" ]]; then - sudo dnf -y install python-devel python-dnf && \ - sudo dnf -y group install "C Development Tools and Libraries" - fi - fi -fi diff --git a/roles/ansible-k8s/Vagrant/bootstrap.yml b/roles/ansible-k8s/Vagrant/bootstrap.yml deleted file mode 100644 index 2fa98ed..0000000 --- a/roles/ansible-k8s/Vagrant/bootstrap.yml +++ /dev/null @@ -1,206 +0,0 @@ ---- -- hosts: all - remote_user: vagrant - become: true - vars: - ansible_ver: '2.2.0.0' - debian_packages: - - 'build-essential' - - 'libffi-dev' - - 'libssl-dev' - - 'python-dev' - - 'python-pip' - - 'python-setuptools' - host_vars_directory: './host_vars' - host_vars_file: '{{ host_vars_directory }}/{{ inventory_hostname }}.yml' - pri_domain_name: 'vagrant.local' - redhat_packages: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - - 'redhat-rpm-config' - ssh_key_path: '.vagrant/machines/{{ inventory_hostname }}/virtualbox/private_key' - suse_packages: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - update_host_vars: true - roles: - tasks: -# Update apt-cache to ensure up to date - - name: Updating Apt Cache (Debian) - apt: - update_cache: yes - cache_valid_time: 3600 - when: ansible_os_family == "Debian" - -# Install pre-reqs for Ansible install - - name: Installing Ansible Pre-Reqs (Debian) - apt: - name: "{{ item }}" - state: "present" - with_items: '{{ debian_packages }}' - when: ansible_os_family == "Debian" - - - name: Installing EPEL Repo (RedHat) - yum: - name: "epel-release" - state: "present" - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -# Install pre-reqs for Ansible install - - name: Installing Ansible Pre-Reqs (RedHat) - yum: - name: "{{ item }}" - state: "present" - with_items: '{{ redhat_packages }}' - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -# Install pre-reqs for Ansible install - - name: Installing Ansible Pre-Reqs (Fedora) - dnf: - name: "python-dnf" - state: "present" - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -# Install pre-reqs for Ansible install - - name: Installing Ansible Pre-Reqs (Fedora) - dnf: - name: "{{ item }}" - state: "present" - with_items: '{{ redhat_packages }}' - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -# Install pre-reqs for Ansible install - - name: Installing Ansible Pre-Reqs (openSUSE) - zypper: - name: "{{ item }}" - state: "present" - with_items: '{{ suse_packages }}' - when: ansible_os_family == "Suse" - -# Upgrading these packages to ensure a successful Ansible install - - name: Updating Python Modules - pip: - name: "{{ item }}" - state: "latest" - with_items: - - 'pip' - - 'cffi' - -# Install Ansible to run Ansible related tasks within guest - - name: Installing Ansible - pip: - name: "ansible" - state: "present" - version: "{{ ansible_ver }}" - -# Check/create host_vars on localhost - - name: Ensuring host_vars Directory Exists - file: - path: "./host_vars" - state: "directory" - delegate_to: "localhost" - run_once: true - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: Ensuring Host File Exists In host_vars - stat: - path: "{{ host_vars_file }}" - delegate_to: "localhost" - register: "host_var" - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: Creating Missing host_vars - file: - path: "{{ host_vars_file }}" - state: "touch" - delegate_to: "localhost" - become: false - when: not host_var.stat.exists - - - name: Updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_eth1.ipv4.address }}" - delegate_to: "localhost" - become: false - register: "ansible_host_updated_eth1" - when: > - (update_host_vars is defined and - update_host_vars) and - (ansible_eth1 is defined and - ansible_eth1.ipv4.address is defined) - - - name: Updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_enp0s8.ipv4.address }}" - delegate_to: "localhost" - become: false - register: "ansible_host_updated_enp0s8" - when: > - (update_host_vars is defined and - update_host_vars) and - (ansible_enp0s8 is defined and - ansible_enp0s8.ipv4.address is defined) - - - name: Updating ansible_ssh_port - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_port{{ ':' }}" - line: "ansible_ssh_port{{ ':' }} 22" - delegate_to: "localhost" - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - (ansible_host_updated_eth1.changed or - ansible_host_updated_enp0s8.changed) - - - name: Updating ansible_ssh_key - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_private_key_file{{ ':' }}" - line: "ansible_ssh_private_key_file{{ ':' }} {{ ssh_key_path }}" - delegate_to: "localhost" - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: Ensuring host_vars Is YAML Formatted - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "---" - line: "---" - insertbefore: "BOF" - delegate_to: "localhost" - become: false - when: > - update_host_vars is defined and - update_host_vars diff --git a/roles/ansible-k8s/Vagrant/cleanup.bat b/roles/ansible-k8s/Vagrant/cleanup.bat deleted file mode 100644 index 6dafb16..0000000 --- a/roles/ansible-k8s/Vagrant/cleanup.bat +++ /dev/null @@ -1,3 +0,0 @@ -vagrant destroy -f -if exist "host_vars" rmdir /S /Q host_vars -if exist ".vagrant" rmdir /S /Q .vagrant diff --git a/roles/ansible-k8s/Vagrant/cleanup.sh b/roles/ansible-k8s/Vagrant/cleanup.sh deleted file mode 100755 index a049429..0000000 --- a/roles/ansible-k8s/Vagrant/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -vagrant destroy -f -if [ -d host_vars ]; then - rm -rf host_vars -fi -if [ -d .vagrant ]; then - rm -rf .vagrant -fi diff --git a/roles/ansible-k8s/Vagrant/hosts b/roles/ansible-k8s/Vagrant/hosts deleted file mode 120000 index 7f6603b..0000000 --- a/roles/ansible-k8s/Vagrant/hosts +++ /dev/null @@ -1 +0,0 @@ -.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/nodes.yml b/roles/ansible-k8s/Vagrant/nodes.yml deleted file mode 100644 index 60523ee..0000000 --- a/roles/ansible-k8s/Vagrant/nodes.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -- name: 'node0' - ansible_groups: - - 'k8s' - box: 'mrlesmithjr/xenial64' - desktop: false - # disks: - # - size: '10' - # controller: "SATA Controller" - # - size: '10' - # controller: "SATA Controller" - interfaces: - - ip: '192.168.250.10' - auto_config: true - method: 'static' - # - ip: '192.168.1.10' - # auto_config: false - # method: 'static' - # network_name: 'network-1' - mem: '1024' - provision: true - vcpu: '1' - # port_forwards: - # - guest: '80' - # host: '8080' - # - guest: '443' - # host: '4433' -- name: 'node1' - ansible_groups: - - 'k8s' - box: 'mrlesmithjr/xenial64' - desktop: false - # disks: - # - size: '10' - # controller: "SATA Controller" - # - size: '10' - # controller: "SATA Controller" - interfaces: - - ip: '192.168.250.11' - auto_config: true - method: 'static' - # - ip: '192.168.1.10' - # auto_config: false - # method: 'static' - # network_name: 'network-1' - mem: '1024' - provision: true - vcpu: '1' - # port_forwards: - # - guest: '80' - # host: '8080' - # - guest: '443' - # host: '4433' -- name: 'node2' - ansible_groups: - - 'k8s' - box: 'mrlesmithjr/xenial64' - desktop: false - # disks: - # - size: '10' - # controller: "SATA Controller" - # - size: '10' - # controller: "SATA Controller" - interfaces: - - ip: '192.168.250.12' - auto_config: true - method: 'static' - # - ip: '192.168.1.10' - # auto_config: false - # method: 'static' - # network_name: 'network-1' - mem: '1024' - provision: true - vcpu: '1' - # port_forwards: - # - guest: '80' - # host: '8080' - # - guest: '443' - # host: '4433' diff --git a/roles/ansible-k8s/Vagrant/playbook.yml b/roles/ansible-k8s/Vagrant/playbook.yml deleted file mode 100644 index 41e0fac..0000000 --- a/roles/ansible-k8s/Vagrant/playbook.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- hosts: k8s - # become: true - vars: - # Define Docker version to install - docker_version: 17.03.2 - # Defines if all nodes in play should be added to each hosts /etc/hosts - etc_hosts_add_all_hosts: true - etc_hosts_pri_dns_name: "{{ pri_domain_name }}" - # Defines if node has static IP. - etc_hosts_static_ip: true - # Defines if ansible_default_ipv4.address is used for defining hosts - etc_hosts_use_default_ip_address: false - # Defines if ansible_ssh_host is used for defining hosts - etc_hosts_use_ansible_ssh_host: true - k8s_cluster_init_skip_ca_verification: true - pri_domain_name: test.vagrant.local - roles: - - role: ansible-change-hostname - - role: ansible-etc-hosts - - role: ansible-timezone - - role: ansible-ntp - - role: ansible-docker - - role: ansible-k8s - tasks: diff --git a/roles/ansible-k8s/Vagrant/prep.sh b/roles/ansible-k8s/Vagrant/prep.sh deleted file mode 100755 index c3e87b1..0000000 --- a/roles/ansible-k8s/Vagrant/prep.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -LINKS=(".gitignore" "ansible.cfg" "bootstrap.bat" "bootstrap.sh" \ - "bootstrap.yml" "cleanup.bat" "cleanup.sh" "playbook.yml" \ - "requirements.yml" "Vagrantfile") -TOP_FOLDER_PATH="../../.." -for i in "${LINKS[@]}" -do - if [ -f "./$i" ]; then - rm "./$i" - fi - if [ ! -L "./$i" ]; then - ln -s $TOP_FOLDER_PATH/$i . - fi -done diff --git a/roles/ansible-k8s/Vagrant/requirements.yml b/roles/ansible-k8s/Vagrant/requirements.yml deleted file mode 120000 index 6e76d52..0000000 --- a/roles/ansible-k8s/Vagrant/requirements.yml +++ /dev/null @@ -1 +0,0 @@ -../requirements.yml \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/.travis.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/README.md b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/README.md deleted file mode 100644 index 3d003c3..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/README.md +++ /dev/null @@ -1,55 +0,0 @@ -Role Name -========= - -Changes the hostname on a node to match the inventory hostname. - -Build Status ------------- - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-change-hostname.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-change-hostname) - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-change-hostname - -# Defines if the node should reboot after changing the hostname -change_hostname_reboot: true -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-change-hostname - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/defaults/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/defaults/main.yml deleted file mode 100644 index 090b59b..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# defaults file for ansible-change-hostname - -# Defines if the node should reboot after changing the hostname -change_hostname_reboot: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/handlers/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/handlers/main.yml deleted file mode 100644 index 51b1e6f..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-change-hostname diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/.galaxy_install_info b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/.galaxy_install_info deleted file mode 100644 index 2e1d9ab..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sun Dec 31 13:31:49 2017', version: ''} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/main.yml deleted file mode 100644 index 4d046e5..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/meta/main.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: Changes the hostname on a node to match the inventory hostname. - #company: your company (optional) - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - - precise - # - quantal - # - raring - # - saucy - - trusty - - utopic - - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tasks/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tasks/main.yml deleted file mode 100644 index 8849857..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tasks/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# tasks file for ansible-change-hostname -- name: main | changing hostname to match inventory_hostname_short - hostname: - name: "{{ inventory_hostname_short }}" - register: "hostname_status" - become: true - when: ansible_hostname != inventory_hostname_short - -- name: main | restarting machine - shell: sleep 2 && shutdown -r now "rebooting to complete hostname change" - async: 1 - poll: 0 - ignore_errors: true - become: true - when: > - (change_hostname_reboot is defined and - change_hostname_reboot ) and - hostname_status.changed - -- name: main | waiting for server to come back - wait_for: - host: "{{ ansible_host | default(inventory_hostname) }}" - port: 22 - search_regex: OpenSSH - delay: 10 - vars: - ansible_connection: local - become: false - when: > - (change_hostname_reboot is defined and - change_hostname_reboot ) and - hostname_status.changed diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tests/test.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tests/test.yml deleted file mode 100644 index 9f4825f..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-change-hostname - tasks: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/vars/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/vars/main.yml deleted file mode 100644 index 5fae5ca..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-change-hostname/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-change-hostname diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/.travis.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/.travis.yml deleted file mode 100644 index 1d51420..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: required - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - # - ansible-playbook tests/test.yml -i tests/inventory - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/LICENSE b/roles/ansible-k8s/Vagrant/roles/ansible-docker/LICENSE deleted file mode 100644 index 120bed5..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Larry Smith Jr. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/README.md b/roles/ansible-k8s/Vagrant/roles/ansible-docker/README.md deleted file mode 100644 index 4934243..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/README.md +++ /dev/null @@ -1,238 +0,0 @@ - - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [ansible-docker](#ansible-docker) - - [Build Status](#build-status) - - [Requirements](#requirements) - - [Role Variables](#role-variables) - - [Dependencies](#dependencies) - - [Example Playbook](#example-playbook) - - [License](#license) - - [Author Information](#author-information) - - - -# ansible-docker - -An [Ansible](https://www.ansible.com) role to install/configure [Docker](https://www.docker.com) - -## Build Status - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-docker.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-docker) - -## Requirements - -None - -## Role Variables - -```yaml ---- -# defaults file for ansible-docker - -# Ensure this exists if setting docker to alternate data directory -# We do not create this to ensure any add'l mounts do not overlay this path -# Service may fail to start if not. -docker_alt_data_dir: '/mnt/docker' - -# Defines address of cluster address -# Not the same as Swarm Cluster address -# Ex. Consul -docker_cluster_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_cluster_interface]['ipv4']['address'] }}" - -# Defines interface to capture address from for docker_cluster_addr -docker_cluster_interface: "{{ docker_swarm_interface }}" - -docker_cluster_port: 2376 - -# Defines if docker should be configured to store data in alternate location -# ensure to enable -g option in docker_opts if true -docker_config_alt_data_dir: false - -# Defines if docker service should be configured -docker_config_service: false - -# Defines if users defined in docker_users should be added to docker group -docker_config_users: false - -# Defines docker images to be installed -docker_images: [] - # # Defines image name - # # ex. docker hub image name - # - name: 'centos' - # # Defines state of image - # # present|absent - # state: 'present' - # - name: 'elasticsearch' - # state: 'present' - # - name: 'fedora' - # state: 'present' - # - name: 'ubuntu' - # state: 'present' - -# Defines if images defined in docker_images are managed -docker_manage_images: false - -# Defines docker service options to be configured in /etc/docker/daemon.json -# Configure each option the same naming/format as the variables are set as at -# https://docs.docker.com/engine/reference/commandline/dockerd/ -# The values are converted directly to proper JSON using the Jinja2 template -docker_opts: -# Only define bridge or bip if you want to use either one of these -# They cannot be used together -# Specify network bridge IP - # bip: '172.17.0.1/8' -# Attach containers to a network bridge - # bridge: 'docker0' -# Address or interface name to advertise - # cluster-advertise: '{{ docker_cluster_addr }}:{{ docker_cluster_port }}' -# Set cluster store options - # cluster-store: 'consul://192.168.250.10:8500' -# Enable debug mode - debug: false -# Container default gateway IPv4 address - # default-gateway: '10.10.10.1' -# Default ulimits for containers - # default-ulimit: - # - nofile: '64000:64000' -# DNS server to use - # dns: - # - '8.8.8.8' - # - '8.8.4.4' -# DNS search domains to use - # dns-search: - # - 'etsbv.internal' - # - 'etsbv.test' -# Enable insecure registry communication - # insecure-registries: - # - 'gitlab.etsbv.internal:5000' -# Default IP when binding container ports - # ip: '0.0.0.0' -# Enable net.ipv4.ip_forward - ip-forward: true -# Enable IP masquerading - ip-masq: true -# Enable addition of iptables rules - iptables: true -# Set key=value labels to the daemon - # label: - # - environment: 'test' - # - datacenter: 'atlanta' -# Default driver for container logs -# Default is json-file - log-driver: 'json-file' -# Fluentd log driver setup - # log-driver: 'fluentd' - # log-opts: - # fluentd-address: 'fluentdhost:24224' - # # fluentd-address: tcp://fluentdhost:24224 -# End of Fluentd log driver setup -# GELF (Graylog) log driver setup - # log-driver: 'gelf' - # log-opts: - # gelf-address: 'udp://1.2.3.4:12201' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of GELF (Graylog) log driver setup -# Splunk log driver setup - # log-driver: 'splunk' - # log-opts: - # splunk-token: '176FCEBF-4CF5-4EDF-91BC-703796522D20' - # splunk-url: 'https://splunkhost:8088' - # splunk-capath: '/path/to/cert/cacert.pem' - # splunk-caname: 'SplunkServerDefaultCert' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of Splunk log driver setup -# Syslog log driver setup - # log-driver: 'syslog' - # log-opts: - # # Define syslog address or leave commented out for logging to host local - # # syslog. - # # syslog-address: 'udp://1.2.3.4:1111' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# Set the logging level - log-level: 'info' -# Set the max concurrent downloads for each pull - max-concurrent-downloads: 3 -# Set the max concurrent uploads for each push - max-concurrent-uploads: 5 -# Set the containers network MTU - # mtu: 1500 -# Enable selinux support - selinux-enabled: false -# Storage driver to use -# aufs, devicemapper, btrfs, zfs, overlay and overlay2 - # storage-driver: 'aufs' -# Set default address or interface for swarm advertised address - swarm-default-advertise-addr: "{{ docker_swarm_addr }}" -# Use TLS; implied by –tlsverify - # tls: false - -# Defines which repo to install from -# Stable gives you reliable updates every quarter -# Edge gives you new features every month -# define as stable or edge -docker_release_channel: 'stable' - -# Defines if docker memory limits should be added to grub boot loader -docker_set_grub_memory_limit: true - -docker_swarm_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_swarm_interface]['ipv4']['address'] }}" - -docker_swarm_interface: 'enp0s8' - -# Defines docker ubuntu repo info for installing from -docker_ubuntu_repo_info: - id: '0EBFCD88' - # keyserver: 'hkp://p80.pool.sks-keyservers.net:80' - repo: 'deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_release_channel }}' - url: 'https://download.docker.com/linux/ubuntu/gpg' - -# Defines users to be added to docker group to allow non sudo access to docker -docker_users: [] - # - 'vagrant' - -# Define Docker version to install -# 1.11.0|1.11.1|1.11.2|1.12.0|1.12.1|1.12.2|1.12.3|1.12.4|1.12.5|1.12.6|1.13.0|1.13.1 -# 17.03.0|17.03.1|17.03.2|17.04.0|17.05.0|17.06.0 -# Currently as of 06/03/2017 17.04.0 and 17.05.0 must be installed from the -# edge channel. Change docker_release_channel: 'edge' -docker_version: 17.06.0 -``` - -## Dependencies - -None - -## Example Playbook - -```yaml ---- -- hosts: docker_hosts - vars: - docker_swarm_interface: "eth1" - docker_config_service: true - pri_domain_name: 'test.vagrant.local' - roles: - - role: ansible-docker - tasks: -``` - -## License - -MIT - -## Author Information - -Larry Smith Jr. - -- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) -- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) -- [mrlesmithjr.com](http://mrlesmithjr.com) -- mrlesmithjr [at] gmail.com diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/defaults/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/defaults/main.yml deleted file mode 100644 index 9f03a47..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/defaults/main.yml +++ /dev/null @@ -1,176 +0,0 @@ ---- -# defaults file for ansible-docker - -# Ensure this exists if setting docker to alternate data directory -# We do not create this to ensure any add'l mounts do not overlay this path -# Service may fail to start if not. -docker_alt_data_dir: '/mnt/docker' - -# Defines address of cluster address -# Not the same as Swarm Cluster address -# Ex. Consul -docker_cluster_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_cluster_interface]['ipv4']['address'] }}" - -# Defines interface to capture address from for docker_cluster_addr -docker_cluster_interface: "{{ docker_swarm_interface }}" - -docker_cluster_port: 2376 - -# Defines if docker should be configured to store data in alternate location -# ensure to enable -g option in docker_opts if true -docker_config_alt_data_dir: false - -# Defines if docker service should be configured -docker_config_service: false - -# Defines if users defined in docker_users should be added to docker group -docker_config_users: false - -# Defines docker images to be installed -docker_images: [] - # # Defines image name - # # ex. docker hub image name - # - name: 'centos' - # # Defines state of image - # # present|absent - # state: 'present' - # - name: 'elasticsearch' - # state: 'present' - # - name: 'fedora' - # state: 'present' - # - name: 'ubuntu' - # state: 'present' - -# Defines if images defined in docker_images are managed -docker_manage_images: false - -# Defines docker service options to be configured in /etc/docker/daemon.json -# Configure each option the same naming/format as the variables are set as at -# https://docs.docker.com/engine/reference/commandline/dockerd/ -# The values are converted directly to proper JSON using the Jinja2 template -docker_opts: -# Only define bridge or bip if you want to use either one of these -# They cannot be used together -# Specify network bridge IP - # bip: '172.17.0.1/8' -# Attach containers to a network bridge - # bridge: 'docker0' -# Address or interface name to advertise - # cluster-advertise: '{{ docker_cluster_addr }}:{{ docker_cluster_port }}' -# Set cluster store options - # cluster-store: 'consul://192.168.250.10:8500' -# Enable debug mode - debug: false -# Container default gateway IPv4 address - # default-gateway: '10.10.10.1' -# Default ulimits for containers - # default-ulimit: - # - nofile: '64000:64000' -# DNS server to use - # dns: - # - '8.8.8.8' - # - '8.8.4.4' -# DNS search domains to use - # dns-search: - # - 'etsbv.internal' - # - 'etsbv.test' -# Enable insecure registry communication - # insecure-registries: - # - 'gitlab.etsbv.internal:5000' -# Default IP when binding container ports - # ip: '0.0.0.0' -# Enable net.ipv4.ip_forward - ip-forward: true -# Enable IP masquerading - ip-masq: true -# Enable addition of iptables rules - iptables: true -# Set key=value labels to the daemon - # label: - # - environment: 'test' - # - datacenter: 'atlanta' -# Default driver for container logs -# Default is json-file - log-driver: 'json-file' -# Fluentd log driver setup - # log-driver: 'fluentd' - # log-opts: - # fluentd-address: 'fluentdhost:24224' - # # fluentd-address: tcp://fluentdhost:24224 -# End of Fluentd log driver setup -# GELF (Graylog) log driver setup - # log-driver: 'gelf' - # log-opts: - # gelf-address: 'udp://1.2.3.4:12201' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of GELF (Graylog) log driver setup -# Splunk log driver setup - # log-driver: 'splunk' - # log-opts: - # splunk-token: '176FCEBF-4CF5-4EDF-91BC-703796522D20' - # splunk-url: 'https://splunkhost:8088' - # splunk-capath: '/path/to/cert/cacert.pem' - # splunk-caname: 'SplunkServerDefaultCert' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# End of Splunk log driver setup -# Syslog log driver setup - # log-driver: 'syslog' - # log-opts: - # # Define syslog address or leave commented out for logging to host local - # # syslog. - # # syslog-address: 'udp://1.2.3.4:1111' - # tag: '{% raw %}{{.Name}}/{{.FullID}}{% endraw %}' - # labels: 'location' - # env: 'TEST' -# Set the logging level - log-level: 'info' -# Set the max concurrent downloads for each pull - max-concurrent-downloads: 3 -# Set the max concurrent uploads for each push - max-concurrent-uploads: 5 -# Set the containers network MTU - # mtu: 1500 -# Enable selinux support - selinux-enabled: false -# Storage driver to use -# aufs, devicemapper, btrfs, zfs, overlay and overlay2 - # storage-driver: 'aufs' -# Set default address or interface for swarm advertised address - swarm-default-advertise-addr: "{{ docker_swarm_addr }}" -# Use TLS; implied by –tlsverify - # tls: false - -# Defines which repo to install from -# Stable gives you reliable updates every quarter -# Edge gives you new features every month -# define as stable or edge -docker_release_channel: 'stable' - -# Defines if docker memory limits should be added to grub boot loader -docker_set_grub_memory_limit: true - -docker_swarm_addr: "{{ hostvars[inventory_hostname]['ansible_' + docker_swarm_interface]['ipv4']['address'] }}" - -docker_swarm_interface: 'enp0s8' - -# Defines docker ubuntu repo info for installing from -docker_ubuntu_repo_info: - id: '0EBFCD88' - # keyserver: 'hkp://p80.pool.sks-keyservers.net:80' - repo: 'deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_release_channel }}' - url: 'https://download.docker.com/linux/ubuntu/gpg' - -# Defines users to be added to docker group to allow non sudo access to docker -docker_users: [] - # - 'vagrant' - -# Define Docker version to install -# 1.11.0|1.11.1|1.11.2|1.12.0|1.12.1|1.12.2|1.12.3|1.12.4|1.12.5|1.12.6|1.13.0|1.13.1 -# 17.03.0|17.03.1|17.03.2|17.04.0|17.05.0|17.06.0 -# Currently as of 06/03/2017 17.04.0 and 17.05.0 must be installed from the -# edge channel. Change docker_release_channel: 'edge' -docker_version: 17.06.0 diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/handlers/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/handlers/main.yml deleted file mode 100644 index f770f2e..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# handlers file for ansible-docker -- name: restart docker - service: - name: "docker" - state: restarted - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/.galaxy_install_info b/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/.galaxy_install_info deleted file mode 100644 index 06d2591..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sun Dec 31 13:31:50 2017', version: ''} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/main.yml deleted file mode 100644 index 12d8fe1..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/meta/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible](https://www.ansible.com) role to install/configure [Docker](https://www.docker.com) - - license: license (MIT) - min_ansible_version: 1.2 - - platforms: - - name: EL - versions: - - 7 - - name: Ubuntu - versions: - - precise - - trusty - - xenial - - zesty - - name: Debian - versions: - - jessie - - stretch - - categories: - - cloud - - development - - packaging - - system -dependencies: [] diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/alpine.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/alpine.yml deleted file mode 100644 index c3310ab..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/alpine.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: alpine | Ensuring Edge Repo Is Enabled - lineinfile: - path: "/etc/apk/repositories" - regexp: "^http://dl-cdn.alpinelinux.org/alpine/edge/community" - line: "http://dl-cdn.alpinelinux.org/alpine/edge/community" - state: "present" - register: "_apk_repos_updated" - become: true - -- name: alpine | Updating APK Cache - apk: - update_cache: true - become: true - when: _apk_repos_updated['changed'] - -- name: alpine | Installing Docker - apk: - name: "docker" - state: "present" - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/config_docker.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/config_docker.yml deleted file mode 100644 index f9a794b..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/config_docker.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: config_docker | Configuring Docker Service (Debian) - template: - src: "etc/default/docker.j2" - dest: "/etc/default/docker" - owner: "root" - group: "root" - mode: 0644 - notify: "restart docker" - become: true - when: ansible_os_family == "Debian" - -- name: config_docker | Ensuring /etc/docker Folder Exists - file: - path: "/etc/docker" - state: "directory" - become: true - -- name: config_docker | Configuring Docker - template: - src: "etc/docker/daemon.json.j2" - dest: "/etc/docker/daemon.json" - notify: "restart docker" - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/debian.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/debian.yml deleted file mode 100644 index 4d823fd..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/debian.yml +++ /dev/null @@ -1,95 +0,0 @@ ---- -- name: debian | updating apt-cache - apt: - update_cache: yes - cache_valid_time: 86400 - become: true - -- name: debian | installing pre-reqs - apt: - name: "{{ item }}" - state: present - become: true - with_items: - - 'apt-transport-https' - - 'ca-certificates' - - 'software-properties-common' - -# We are removing the old Docker info -- name: debian | Removing Legacy Docker apt-key - apt_key: - keyserver: "hkp://p80.pool.sks-keyservers.net:80" - id: "58118E89F3A912897C070ADBF76221572C52609D" - state: "absent" - become: true - -# We are removing the old Docker info -- name: debian | Removing Legacy Docker Repo - apt_repository: - repo: "deb https://apt.dockerproject.org/repo {{ ansible_distribution | lower }}-{{ ansible_distribution_release }} main" - state: "absent" - become: true - -- name: debian | adding docker apt-key - apt_key: - url: "{{ docker_ubuntu_repo_info['url'] }}" - id: "{{ docker_ubuntu_repo_info['id'] }}" - state: "present" - become: true - -- name: debian | adding docker repo - apt_repository: - repo: "{{ docker_ubuntu_repo_info['repo'] }}" - state: present - become: true - -# We remove docker-engine as this is old package to install. The new package is -# docker-ce -- name: debian | uninstalling old docker package (if exists) - apt: - name: "{{ item }}" - state: "absent" - purge: yes - become: true - with_items: - - 'docker-engine' - - 'lxc-docker' - -- name: debian | installing docker pre-reqs - apt: - name: "linux-image-extra-{{ ansible_kernel }}" - state: present - become: true - when: > - ansible_distribution == "Ubuntu" and - (ansible_distribution_version >= '14.04') - -- name: debian | installing docker - apt: - name: "docker-ce={{ docker_version_debian }}" - state: "present" - become: true - -- name: debian | setting grub memory limit (if set) - lineinfile: - dest: /etc/default/grub - regexp: "^GRUB_CMDLINE_LINUX_DEFAULT" - line: 'GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1"' - register: grub_updated - become: true - when: > - docker_set_grub_memory_limit is defined and - docker_set_grub_memory_limit - -- name: debian | updating grub (if updated) - command: update-grub - become: true - when: grub_updated['changed'] - -- name: debian | installing additonal packages - apt: - name: "{{ item }}" - state: "present" - become: true - with_items: - - bridge-utils diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/images.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/images.yml deleted file mode 100644 index 1a42ed3..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/images.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: images | ensuring docker images are present - docker_image: - name: "{{ item['name'] }}" - state: "{{ item['state'] }}" - become: true - with_items: '{{ docker_images }}' diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/main.yml deleted file mode 100644 index 0c3300a..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# tasks file for ansible-docker -- include: set_facts.yml - -- include: alpine.yml - when: ansible_os_family == "Alpine" - -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: config_docker.yml - when: docker_config_service - -- include: service.yml - -- include: users.yml - when: > - docker_config_users is defined and - docker_config_users - -- include: manage_python_modules.yml - -- include: images.yml - when: > - docker_manage_images and - docker_images is defined diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/manage_python_modules.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/manage_python_modules.yml deleted file mode 100644 index 1da4a78..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/manage_python_modules.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -- name: manage_python_modules | installing python pre-req packages (Debian) - apt: - name: "{{ item }}" - state: present - become: true - with_items: - - 'build-essential' - - 'libffi-dev' - - 'libssl-dev' - - 'python-dev' - - 'python-pip' - - 'python-setuptools' - when: ansible_os_family == "Debian" - -- name: manage_python_modules | installing python pre-req packages (RedHat) - yum: - name: "{{ item }}" - state: present - become: true - with_items: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - - 'redhat-rpm-config' - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -- name: manage_python_modules | Installing Ansible Pre-Reqs (Fedora) - dnf: - name: "python-dnf" - state: "present" - become: true - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: manage_python_modules | installing python pre-req packages (Fedora) - dnf: - name: "{{ item }}" - state: present - become: true - with_items: - - 'gmp-devel' - - 'libffi-devel' - - 'openssl-devel' - - 'python-crypto' - - 'python-devel' - - 'python-pip' - - 'python-setuptools' - - 'redhat-rpm-config' - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: manage_python_modules | installing python modules - pip: - name: "{{ item }}" - state: present - become: true - with_items: - - 'docker-compose' - # - 'docker-py' diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/redhat.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/redhat.yml deleted file mode 100644 index fd866f7..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/redhat.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -- name: redhat | Installing Pre-Reqs (Fedora) - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'device-mapper-persistent-data' - - 'libselinux-python' - - 'lvm2' - - 'yum-utils' - when: ansible_distribution == "Fedora" - -- name: redhat | Installing Pre-Reqs (!=Fedora) - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'device-mapper-persistent-data' - - 'libselinux-python' - - 'lvm2' - - 'yum-utils' - when: ansible_distribution != "Fedora" - -- name: redhat | Uninstalling Old Docker Package (if exists) - yum: - name: "{{ item }}" - state: "absent" - become: true - with_items: - - 'container-selinux' - - 'docker-common' - - 'docker-engine' - - 'docker-selinux' - - 'docker' - -- name: redhat | adding Docker repo - template: - src: "etc/yum.repos.d/docker.repo.j2" - dest: "/etc/yum.repos.d/docker.repo" - become: true - -- name: redhat | installing Docker - yum: - name: "docker-ce-{{ docker_version_redhat }}" - state: present - become: true - when: ansible_distribution != "Fedora" - -- name: redhat | installing Docker - dnf: - name: "docker-ce-{{ docker_version_redhat }}" - state: present - become: true - when: ansible_distribution == "Fedora" diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/service.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/service.yml deleted file mode 100644 index 75f6754..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/service.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: service | Ensuring Docker Service Is Started And Enabled On Boot - service: - name: "docker" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/set_facts.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/set_facts.yml deleted file mode 100644 index e9ddf56..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/set_facts.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}-0~{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version < '1.12.4') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}-0~{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '1.12.4' and - docker_version <= '1.13.1') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}~ce-0~{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '17.03' and - docker_version < '17.06') - -- name: set_facts | Setting Docker Version To Install (Debian) - set_fact: - docker_version_debian: '{{ docker_version }}~ce-0~{{ ansible_distribution|lower }}' - when: > - ansible_os_family == "Debian" and - (docker_version >= '17.06') - -- name: set_facts | Setting Docker Version To Install (Fedora) - set_fact: - docker_version_redhat: '{{ docker_version }}-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution == "Fedora") and - (docker_version < '17.03') - -- name: set_facts | Setting Docker Version To Install (Fedora) - set_fact: - docker_version_redhat: '{{ docker_version }}.ce-1.fc{{ ansible_distribution_major_version }}' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution == "Fedora") and - (docker_version >= '17.03') - -- name: set_facts | Setting Docker Version To Install (RedHat) - set_fact: - docker_version_redhat: '{{ docker_version }}-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution != "Fedora") and - (docker_version < '17.03') and - ansible_distribution_major_version == '7' - -- name: set_facts | Setting Docker Version To Install (RedHat) - set_fact: - docker_version_redhat: '{{ docker_version }}.ce-1.el7.centos' - when: > - (ansible_os_family == "RedHat" and - ansible_distribution != "Fedora") and - (docker_version >= '17.03') and - ansible_distribution_major_version == '7' - -- name: Installing Docker Version On Debian - debug: msg="Installing Docker Version {{ docker_version_debian }}" - when: ansible_os_family == "Debian" - -- name: Installing Docker Version On RedHat - debug: msg="Installing Docker Version {{ docker_version_redhat }}" - when: ansible_os_family == "RedHat" diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/users.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/users.yml deleted file mode 100644 index 3bbe4d3..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tasks/users.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: users | adding docker users (for use without sudo) - user: - name: "{{ item }}" - append: yes - groups: docker - become: true - with_items: '{{ docker_users }}' diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/default/docker.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/default/docker.j2 deleted file mode 100644 index 06474d0..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/default/docker.j2 +++ /dev/null @@ -1 +0,0 @@ -DOCKER_OPTS="--config-file=/etc/docker/daemon.json" diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2 deleted file mode 100644 index 083eee9..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% if docker_opts is defined %} -{{ docker_opts|to_nice_json }} -{% endif %} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig b/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig deleted file mode 100644 index 2a75e25..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/docker/daemon.json.j2.orig +++ /dev/null @@ -1,66 +0,0 @@ -{% set docker_options = {} %} -{% if docker_opts.bridge is defined %} -{% set _opts = docker_options.update({"bridge": docker_opts.bridge}) %} -{% endif %} -{% if docker_opts.bridge_ip is defined %} -{% set _opts = docker_options.update({"bip": docker_opts.bridge_ip}) %} -{% endif %} -{% if docker_opts.dns is defined %} -{% set _dns_servers = [] %} -{% for item in docker_opts.dns %} -{% set _opts = _dns_servers.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"dns": _dns_servers}) %} -{% endif %} -{% if docker_opts.dns_search is defined %} -{% set _dns_search = [] %} -{% for item in docker_opts.dns_search %} -{% set _opts = _dns_search.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"dns-search": _dns_search}) %} -{% endif %} -{% if docker_opts.insecure_registries is defined %} -{% set _insecure_registries = [] %} -{% for item in docker_opts.insecure_registries %} -{% set _opts = _insecure_registries.append(item) %} -{% endfor %} -{% set _opts = docker_options.update({"insecure-registries": _insecure_registries}) %} -{% endif %} -{% if docker_opts.ip is defined %} -{% set _opts = docker_options.update({"ip": docker_opts.ip}) %} -{% endif %} -{% if docker_opts.ip_forward is defined %} -{% set _opts = docker_options.update({"ip-forward": docker_opts.ip_forward}) %} -{% endif %} -{% if docker_opts.ip_masq is defined %} -{% set _opts = docker_options.update({"ip-masq": docker_opts.ip_masq}) %} -{% endif %} -{% if docker_opts.iptables is defined %} -{% set _opts = docker_options.update({"iptables": docker_opts.iptables}) %} -{% endif %} -{% if docker_opts.labels is defined %} -{% set _labels = [] %} -{% for item in docker_opts.labels %} -{% set _opts = _labels.append(item.key+"="+item.value) %} -{% endfor %} -{% set _opts = docker_options.update({"labels": _labels}) %} -{% endif %} -{% if docker_opts.log_driver is defined %} -{% set _opts = docker_options.update({"log-driver": docker_opts.log_driver}) %} -{% endif %} -{% if docker_opts.log_level is defined %} -{% set _opts = docker_options.update({"log-level": docker_opts.log_level}) %} -{% endif %} -{% if docker_opts.max_concurrent_downloads is defined %} -{% set _opts = docker_options.update({"max-concurrent-downloads": docker_opts.max_concurrent_downloads|int}) %} -{% endif %} -{% if docker_opts.max_concurrent_uploads is defined %} -{% set _opts = docker_options.update({"max-concurrent-uploads": docker_opts.max_concurrent_uploads|int}) %} -{% endif %} -{% if docker_opts.storage_driver is defined %} -{% set _opts = docker_options.update({"storage-driver": docker_opts.storage_driver}) %} -{% endif %} -{% if docker_opts.tls is defined %} -{% set _opts = docker_options.update({"tls": docker_opts.tls}) %} -{% endif %} -{{ docker_options| to_nice_json }} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 deleted file mode 100644 index b5e3430..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/templates/etc/yum.repos.d/docker.repo.j2 +++ /dev/null @@ -1,20 +0,0 @@ -[docker-ce-{{ docker_release_channel }}] -name=Docker CE {{ docker_release_channel }} - $basearch -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/$basearch/{{ docker_release_channel }} -enabled=1 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg - -[docker-ce-{{ docker_release_channel }}-debuginfo] -name=Docker CE {{ docker_release_channel }} - Debuginfo $basearch -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/debug-$basearch/{{ docker_release_channel }} -enabled=0 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg - -[docker-ce-{{ docker_release_channel }}-source] -name=Docker CE {{ docker_release_channel }} - Sources -baseurl=https://download.docker.com/linux/{{ ansible_distribution|lower }}/{{ ansible_distribution_major_version }}/source/{{ docker_release_channel }} -enabled=0 -gpgcheck=1 -gpgkey=https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/inventory b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/inventory deleted file mode 100644 index 2fbb50c..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/test.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/test.yml deleted file mode 100644 index 1b0f1d4..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-docker - tasks: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-docker/vars/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-docker/vars/main.yml deleted file mode 100644 index 5e2444b..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-docker/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-docker diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/.travis.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/README.md b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/README.md deleted file mode 100644 index 5d8e07d..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/README.md +++ /dev/null @@ -1,65 +0,0 @@ -Role Name -========= - -An [Ansible] role that Configures /etc/hosts - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-etc-hosts -# Defines if all nodes in play should be added to each hosts /etc/hosts -etc_hosts_add_all_hosts: false - -# Defines if ipv6 info is included in /etc/hosts -etc_hosts_enable_ipv6: true - -# Defines your primary dns suffix -etc_hosts_pri_dns_name: 'vagrant.local' - -# Defines if node has static IP. -etc_hosts_static_ip: false - -# Defines if ansible_host is used for defining hosts -etc_hosts_use_ansible_ssh_host: true - -# Defines if ansible_default_ipv4.address is used for defining hosts -etc_hosts_use_default_ip_address: false -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-etc-hosts -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/defaults/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/defaults/main.yml deleted file mode 100644 index 2291b56..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/defaults/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# defaults file for ansible-etc-hosts -# Defines if all nodes in play should be added to each hosts /etc/hosts -etc_hosts_add_all_hosts: false - -# Defines if ipv6 info is included in /etc/hosts -etc_hosts_enable_ipv6: true - -# Defines your primary dns suffix -etc_hosts_pri_dns_name: 'vagrant.local' - -# Defines if node has static IP. -etc_hosts_static_ip: false - -# Defines if ansible_host is used for defining hosts -etc_hosts_use_ansible_ssh_host: true - -# Defines if ansible_default_ipv4.address is used for defining hosts -etc_hosts_use_default_ip_address: false diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/handlers/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/handlers/main.yml deleted file mode 100644 index a202eb9..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-etc-hosts diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/.galaxy_install_info b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/.galaxy_install_info deleted file mode 100644 index 06d2591..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sun Dec 31 13:31:50 2017', version: ''} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/main.yml deleted file mode 100644 index 764e269..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/meta/main.yml +++ /dev/null @@ -1,149 +0,0 @@ -galaxy_info: - author: Larry Smith Jr. - description: An Ansible role that configures /etc/hosts - #company: your company (optional) - - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - - min_ansible_version: 1.2 - - # Optionally specify the branch Galaxy will use when accessing the GitHub - # repo for this role. During role install, if no tags are available, - # Galaxy will use this branch. During import Galaxy will access files on - # this branch. If travis integration is cofigured, only notification for this - # branch will be accepted. Otherwise, in all cases, the repo's default branch - # (usually master) will be used. - #github_branch: - - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Solaris - # versions: - # - all - # - 10 - # - 11.0 - # - 11.1 - # - 11.2 - # - 11.3 - - name: Fedora - versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - - 20 - - 21 - - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - - galaxy_tags: - # List tags for your role here, one per line. A tag is - # a keyword that describes and categorizes the role. - # Users find roles by searching for tags. Be sure to - # remove the '[]' above if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of - # alphanumeric characters. Maximum 20 tags per role. - - system - -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tasks/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tasks/main.yml deleted file mode 100644 index a31f818..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tasks/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# tasks file for ansible-etc-hosts -- name: pre-reqs (RedHat) - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - libselinux-python - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - -- name: pre-reqs (RedHat) - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - libselinux-python - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - -- name: main | updating /etc/hosts (localhost) - template: - src: "etc/hosts.j2" - dest: "/etc/hosts" - owner: root - group: root - mode: 0644 - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/templates/etc/hosts.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/templates/etc/hosts.j2 deleted file mode 100644 index c0781ee..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/templates/etc/hosts.j2 +++ /dev/null @@ -1,81 +0,0 @@ -127.0.0.1 localhost - -{% if not etc_hosts_add_all_hosts %} -{% if (ansible_domain == etc_hosts_pri_dns_name) or ansible_domain == '' %} -{% if not etc_hosts_static_ip %} -{% if inventory_hostname == inventory_hostname_short %} -{% if ansible_fqdn != (ansible_hostname + '.' + etc_hosts_pri_dns_name) %} -127.0.1.1 {{ ansible_hostname }}.{{ etc_hosts_pri_dns_name }} {{ ansible_hostname }} -{% elif ansible_fqdn == (ansible_hostname + '.' + etc_hosts_pri_dns_name) %} -127.0.1.1 {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% if inventory_hostname != inventory_hostname_short %} -{% if ansible_fqdn != inventory_hostname %} -127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} -{% elif ansible_fqdn == inventory_hostname %} -127.0.1.1 {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% elif etc_hosts_static_ip %} -{% if ansible_ssh_host is defined %} -{{ ansible_ssh_host }} {{ ansible_fqdn }} {{ ansible_hostname }} -{% elif ansible_host is defined %} -{{ ansible_host }} {{ ansible_fqdn }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% elif (ansible_domain != etc_hosts_pri_dns_name) and ansible_domain != '' %} -{% if (ansible_fqdn == inventory_hostname) and (inventory_hostname != inventory_hostname_short) %} -{% if not etc_hosts_static_ip %} -127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} -{% elif etc_hosts_static_ip %} -{% if ansible_ssh_host is defined %} -{{ ansible_ssh_host }} {{ inventory_hostname }} {{ ansible_hostname }} -{% elif ansible_host is defined %} -{{ ansible_host }} {{ inventory_hostname }} {{ ansible_hostname }} -{% endif %} -{% endif %} -{% endif %} -{% endif %} -{% elif etc_hosts_add_all_hosts %} -{% for host in play_hosts %} -{% if (hostvars[host]['ansible_domain'] == etc_hosts_pri_dns_name) or hostvars[host]['ansible_domain'] == '' %} -{% if etc_hosts_use_default_ip_address and not etc_hosts_use_ansible_ssh_host %} -{{ hostvars[host]['ansible_default_ipv4']['address'] }} {{ hostvars[host]['ansible_fqdn'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% elif not etc_hosts_use_default_ip_address and etc_hosts_use_ansible_ssh_host %} -{% if hostvars[host]['ansible_fqdn'] != (hostvars[host]['ansible_hostname']+ '.' + etc_hosts_pri_dns_name) %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_hostname'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_hostname'] }}.{{ etc_hosts_pri_dns_name }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% elif hostvars[host]['ansible_fqdn'] == (hostvars[host]['ansible_hostname']+ '.' + etc_hosts_pri_dns_name) %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% endif %} -{% endif %} -{% elif (hostvars[host]['ansible_domain'] != etc_hosts_pri_dns_name) and ansible_domain != '' %} -{% if (hostvars[host]['ansible_fqdn'] == inventory_hostname) and (inventory_hostname != inventory_hostname_short) %} -{% if etc_hosts_use_default_ip_address and not etc_hosts_use_ansible_ssh_host %} -{{ hostvars[host]['ansible_default_ipv4']['address'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif not etc_hosts_use_default_ip_address and etc_hosts_use_ansible_ssh_host %} -{% if hostvars[host]['ansible_ssh_host'] is defined %} -{{ hostvars[host]['ansible_ssh_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% elif hostvars[host]['ansible_host'] is defined %} -{{ hostvars[host]['ansible_host'] }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} -{% endif %} -{% endif %} -{% endif %} -{% endif %} -{% endfor %} -{% endif %} - -{% if etc_hosts_enable_ipv6 %} -# The following lines are desirable for IPv6 capable hosts -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -{% endif %} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/inventory b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/test.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/test.yml deleted file mode 100644 index b642979..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-etc-hosts \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/vars/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/vars/main.yml deleted file mode 100644 index 8a754aa..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-etc-hosts/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-etc-hosts diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-k8s b/roles/ansible-k8s/Vagrant/roles/ansible-k8s deleted file mode 120000 index 6581736..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-k8s +++ /dev/null @@ -1 +0,0 @@ -../../ \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/.travis.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/.travis.yml deleted file mode 100644 index 43aaf08..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: required - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - - ansible-playbook tests/test.yml -i tests/inventory - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/README.md b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/README.md deleted file mode 100644 index 84c689e..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/README.md +++ /dev/null @@ -1,74 +0,0 @@ -Role Name -========= - -An [Ansible] role to install/configure NTP - -Build Status ------------- - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-ntp.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-ntp) - -Requirements ------------- - -Define ntp_master for your group of servers which should be used for your -internal ntp servers for clients to connect to. -ex. group_vars/ntp_masters - -Role Variables --------------- - -``` ---- -# defaults file for ansible-ntp -# Defines if host is ntp_master -# set ntp_master to true on specific group_vars/group -ntp_master: false - -# Define your ntp_master_servers -ntp_master_servers: - - 0.ubuntu.pool.ntp.org - - 1.ubuntu.pool.ntp.org - - 2.ubuntu.pool.ntp.org - - 3.ubuntu.pool.ntp.org - -# Defines your primary domain name (FQDN) -ntp_pri_domain_name: 'example.org' - -# Defines internal ntp servers for clients to poll -# ntp_servers: -# - 'ntp1.{{ ntp_pri_domain_name }}' -# - 'ntp2.{{ ntp_pri_domain_name }}' -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-ntp - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/defaults/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/defaults/main.yml deleted file mode 100644 index ea16ccc..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# defaults file for ansible-ntp -# Defines if host is ntp_master -# set ntp_master to true on specific group_vars/group -ntp_master: false - -# Define your ntp_master_servers -ntp_master_servers: - - 0.ubuntu.pool.ntp.org - - 1.ubuntu.pool.ntp.org - - 2.ubuntu.pool.ntp.org - - 3.ubuntu.pool.ntp.org - -# Defines your primary domain name (FQDN) -ntp_pri_domain_name: 'example.org' - -# Defines internal ntp servers for clients to poll -# ntp_servers: -# - 'ntp1.{{ ntp_pri_domain_name }}' -# - 'ntp2.{{ ntp_pri_domain_name }}' diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/handlers/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/handlers/main.yml deleted file mode 100644 index 8565161..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/handlers/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# handlers file for ansible-ntp -- name: restart ntp - service: - name: "ntp" - state: "restarted" - become: true - when: not ansible_check_mode - -- name: restart ntpd - service: - name: "ntpd" - state: "restarted" - become: true - when: not ansible_check_mode diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/.galaxy_install_info b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/.galaxy_install_info deleted file mode 100644 index 92d6896..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sun Dec 31 13:31:51 2017', version: ''} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/main.yml deleted file mode 100644 index f16ea9c..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/meta/main.yml +++ /dev/null @@ -1,136 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to install/configure NTP - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - # - all - # - etch - - jessie - # - lenny - # - squeeze - - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - - networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/debian.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/debian.yml deleted file mode 100644 index 81de783..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/debian.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: debian | installing packages - apt: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'ntp' - -- name: debian | configuring ntp - template: - src: "etc/ntp.conf.j2" - dest: "/etc/ntp.conf" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - notify: restart ntp - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/main.yml deleted file mode 100644 index fe065f4..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# tasks file for ansible-ntp -- include: debian.yml - tags: - - config_ntp - when: ansible_os_family == "Debian" - -- include: redhat.yml - tags: - - config_ntp - when: ansible_os_family == "RedHat" diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/redhat.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/redhat.yml deleted file mode 100644 index 74826bd..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tasks/redhat.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: redhat | installing packages - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - ntp - when: > - ansible_distribution != "Fedora" - -- name: redhat | installing packages - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - ntp - when: > - ansible_distribution == "Fedora" - -- name: redhat | configuring ntp - template: - src: "etc/ntp.conf.j2" - dest: "/etc/ntp.conf" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - become: true - notify: restart ntpd - -- name: redhat | ensuring ntpd service is started and enabled on boot - service: - name: "ntpd" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/templates/etc/ntp.conf.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/templates/etc/ntp.conf.j2 deleted file mode 100644 index f8c0500..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/templates/etc/ntp.conf.j2 +++ /dev/null @@ -1,35 +0,0 @@ -driftfile /var/lib/ntp/ntp.drift -statistics loopstats peerstats clockstats -filegen loopstats file loopstats type day enable -filegen peerstats file peerstats type day enable -filegen clockstats file clockstats type day enable -{% if ntp_master %} -{% if ntp_master_servers is defined %} -{% for server in ntp_master_servers %} -server {{ server }} -{% endfor %} -# Below 127.127.1.1 setting refer to the system time on the current machine in -# case of network isolation. -server 127.127.1.1 -fudge 127.127.1.1 stratum 5 -{% endif %} -{% endif %} -{% if not ntp_master %} -{% if ntp_servers is defined %} -{% for server in ntp_servers %} -server {{ server }} -{% endfor %} -{% endif %} -{% if ntp_servers is not defined %} -server 0.ubuntu.pool.ntp.org -server 1.ubuntu.pool.ntp.org -server 2.ubuntu.pool.ntp.org -server 3.ubuntu.pool.ntp.org -{% endif %} -{% endif %} -# Use Ubuntu's ntp server as a fallback. -server ntp.ubuntu.com -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery -restrict 127.0.0.1 -restrict ::1 diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/inventory b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/test.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/test.yml deleted file mode 100644 index d0bd082..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: localhost - remote_user: root - connection: local - roles: - - ansible-ntp diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/vars/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-ntp/vars/main.yml deleted file mode 100644 index 212a789..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-ntp/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-ntp diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/.travis.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/.travis.yml deleted file mode 100644 index a6886a3..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - - ansible-playbook tests/test.yml -i tests/inventory --check - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/README.md b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/README.md deleted file mode 100644 index 6444d2a..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/README.md +++ /dev/null @@ -1,62 +0,0 @@ -Role Name -========= - -An [Ansible] role to configure timezone settings - -Build Status ------------- -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-timezone.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-timezone) - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-timezone - -# set your desired default timezone - -# timezone: 'EST5EDT' -# timezone: 'America/New_York' -timezone: 'UTC' - -timezone_update_hardware_clock: false -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` ---- -- hosts: all - become: true - vars: - roles: - - role: ansible-timezone - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/defaults/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/defaults/main.yml deleted file mode 100644 index fe3177d..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/defaults/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# defaults file for ansible-timezone - -# set your desired default timezone - -# timezone: 'EST5EDT' -# timezone: 'America/New_York' -timezone: 'UTC' - -timezone_update_hardware_clock: false diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/handlers/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/handlers/main.yml deleted file mode 100644 index 8053e2f..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for ansible-timezone -- name: update tzdata - command: "dpkg-reconfigure --frontend noninteractive tzdata" diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/.galaxy_install_info b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/.galaxy_install_info deleted file mode 100644 index 92d6896..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sun Dec 31 13:31:51 2017', version: ''} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/main.yml deleted file mode 100644 index f4d27d5..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/meta/main.yml +++ /dev/null @@ -1,133 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to configure timezone settings - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - - name: Fedora - versions: - - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - # - utopic - # - vivid - # - xenial - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tasks/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tasks/main.yml deleted file mode 100644 index 4425d2d..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# tasks file for ansible-timezone - -- name: main | Setting Timezone - timezone: - name: "{{ timezone }}" - tags: - - configuration - - timezone - when: not timezone_update_hardware_clock - -- name: main | Setting Timezone And Hardware Clock - timezone: - name: "{{ timezone }}" - hwclock: true - tags: - - configuration - - timezone - when: timezone_update_hardware_clock diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/templates/timezone.j2 b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/templates/timezone.j2 deleted file mode 100644 index 0b6d009..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/templates/timezone.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ timezone }} diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/inventory b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/inventory deleted file mode 100644 index 2fbb50c..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/test.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/test.yml deleted file mode 100644 index 38b05e3..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-timezone - tasks: diff --git a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/vars/main.yml b/roles/ansible-k8s/Vagrant/roles/ansible-timezone/vars/main.yml deleted file mode 100644 index 993f6d1..0000000 --- a/roles/ansible-k8s/Vagrant/roles/ansible-timezone/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-timezone diff --git a/roles/ansible-k8s/defaults/main.yml b/roles/ansible-k8s/defaults/main.yml deleted file mode 100644 index 2ab0e31..0000000 --- a/roles/ansible-k8s/defaults/main.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -# defaults file for ansible-k8s -# -k8s_admin_config: /etc/kubernetes/admin.conf - -# Define Ansible group which defines the K8s Cluster -k8s_advertise_address_int: enp0s8 - -k8s_advertise_bind_port: 6443 - -k8s_cluster_group: k8s - -k8s_cluster_init_skip_ca_verification: false - -k8s_dashboard: https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml - -k8s_debian_packages: - - kubelet - - kubeadm - - kubectl - - kubernetes-cni - -k8s_debian_repo_info: - key: "{{ k8s_package_url }}/apt/doc/apt-key.gpg" - repo: "deb http://apt.kubernetes.io/ kubernetes-{{ ansible_distribution_release|lower }} main" - -# https://github.com/kubernetes/helm - -# Define architecture to install...amd64|arm -k8s_helm_architecture: amd64 - -k8s_helm_install: false - -k8s_helm_install_dir: /usr/local/bin - -k8s_helm_package: "helm-v{{ k8s_helm_version }}-linux-{{ k8s_helm_architecture }}.tar.gz" - -k8s_helm_url: https://kubernetes-helm.storage.googleapis.com - -k8s_helm_version: 2.7.2 - -k8s_package_url: https://packages.cloud.google.com - -k8s_pod_network_config: "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" - -k8s_reports: - all_pod_namespaces: true - all_service_namespaces: true - display_dashboard_link: true - -k8s_reset_cluster: false - -# Defines services which should be enabled on boot -k8s_services: - - kubelet - -k8s_token_file: /etc/kubernetes/.k8s_token - -k8s_users: - - user: vagrant - -k8s_version: 1.10.2 diff --git a/roles/ansible-k8s/handlers/main.yml b/roles/ansible-k8s/handlers/main.yml deleted file mode 100644 index 03c7e08..0000000 --- a/roles/ansible-k8s/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-k8s \ No newline at end of file diff --git a/roles/ansible-k8s/meta/.galaxy_install_info b/roles/ansible-k8s/meta/.galaxy_install_info deleted file mode 100644 index 2a6272f..0000000 --- a/roles/ansible-k8s/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Thu May 3 12:16:46 2018', version: v1.1.0} diff --git a/roles/ansible-k8s/meta/main.yml b/roles/ansible-k8s/meta/main.yml deleted file mode 100644 index 1b8d819..0000000 --- a/roles/ansible-k8s/meta/main.yml +++ /dev/null @@ -1,20 +0,0 @@ -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to deploy a [Kubernetes] - K8s Cluster - - license: MIT - - min_ansible_version: 1.2 - - platforms: - - name: Ubuntu - versions: - - xenial - - galaxy_tags: - - clustering - - kubernetes - - containers - - docker - -dependencies: [] diff --git a/roles/ansible-k8s/requirements.yml b/roles/ansible-k8s/requirements.yml deleted file mode 100644 index 64cf300..0000000 --- a/roles/ansible-k8s/requirements.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- src: https://www.github.com/mrlesmithjr/ansible-change-hostname.git -- src: https://www.github.com/mrlesmithjr/ansible-docker.git -- src: https://www.github.com/mrlesmithjr/ansible-etc-hosts.git -- src: https://www.github.com/mrlesmithjr/ansible-ntp.git -- src: https://www.github.com/mrlesmithjr/ansible-timezone.git diff --git a/roles/ansible-k8s/tasks/cluster_services.yml b/roles/ansible-k8s/tasks/cluster_services.yml deleted file mode 100644 index 290dc51..0000000 --- a/roles/ansible-k8s/tasks/cluster_services.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: cluster_services | Capturing K8s Services - command: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - get services --all-namespaces -o json - changed_when: false - become: true - tags: - - k8s_get_dashboard - register: _k8s_get_services_all - when: k8s_reports['all_service_namespaces'] - -- name: cluster_services | Displaying K8s Services - debug: var=(_k8s_get_services_all['stdout']|from_json)['items'] - # debug: - # msg: "{{ lookup('template', 'k8s_services.j2') }}" - when: k8s_reports['all_service_namespaces'] diff --git a/roles/ansible-k8s/tasks/cluster_summary.yml b/roles/ansible-k8s/tasks/cluster_summary.yml deleted file mode 100644 index 30f38de..0000000 --- a/roles/ansible-k8s/tasks/cluster_summary.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: cluster_summary | Capturing Cluster Nodes - command: > - kubectl --kubeconfig {{ k8s_admin_config }} get nodes - changed_when: false - become: true - # We wait for the number of nodes to match the number of hosts defined in - # the ansible group. We subtract 1 to account for the header line - until: > - ((_k8s_cluster_nodes['stdout_lines']|length - 1) == (groups[k8s_cluster_group]|length) and - 'NotReady' not in _k8s_cluster_nodes['stdout']) - retries: 30 - delay: 10 - register: _k8s_cluster_nodes - when: inventory_hostname == k8s_master - -# We capture as JSON in order to use for later iteration -- name: cluster_summary | Capturing Cluster Nodes (JSON) - command: > - kubectl --kubeconfig {{ k8s_admin_config }} get nodes -o json - changed_when: false - become: true - register: _k8s_cluster_nodes_json - when: inventory_hostname == k8s_master - -- name: cluster_summary | Displaying Cluster Nodes - debug: var=_k8s_cluster_nodes['stdout_lines'] - when: inventory_hostname == k8s_master - -# - debug: var=_k8s_cluster_nodes_json['stdout'] -# when: inventory_hostname == k8s_master diff --git a/roles/ansible-k8s/tasks/dashboard.yml b/roles/ansible-k8s/tasks/dashboard.yml deleted file mode 100644 index 87a7a5f..0000000 --- a/roles/ansible-k8s/tasks/dashboard.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- name: dashboard | Checking For Existing Dashboard - shell: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - get pods --all-namespaces | grep dashboard - become: true - register: _k8s_dashboard - failed_when: (_k8s_dashboard['rc'] > 1) - changed_when: false - when: inventory_hostname == k8s_master - -- name: dashboard | Loading K8s Dashboard - command: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - apply -f {{ k8s_dashboard }} - become: true - when: > - (inventory_hostname == k8s_master) and - (_k8s_dashboard['rc'] == 1) - -# - debug: var=(_k8s_get_services_all['stdout']|from_json)['items'] -# tags: -# - 'k8s_get_dashboard' - -# - debug: var=k8s_reports['display_dashboard_link'] -# tags: -# - 'k8s_get_dashboard' - -- name: dashboard | Dashboard - debug: - msg: "{{ lookup('template', 'k8s_dashboard.j2') }}" - when: > - (inventory_hostname == k8s_master) and - _k8s_get_services_all is defined and - k8s_reports['display_dashboard_link'] and - (_k8s_dashboard['rc'] == 0) diff --git a/roles/ansible-k8s/tasks/debian.yml b/roles/ansible-k8s/tasks/debian.yml deleted file mode 100644 index 63ca7fd..0000000 --- a/roles/ansible-k8s/tasks/debian.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: debian | Installing Pre-Reqs - apt: - name: "{{ item }}" - state: present - become: true - with_items: - - apt-transport-https - - jq - -- name: debian | Adding K8s Repo Key - apt_key: - url: "{{ k8s_debian_repo_info['key'] }}" - state: present - become: true - -- name: debian | Adding K8s Repo - apt_repository: - repo: "{{ k8s_debian_repo_info['repo'] }}" - state: present - become: true - -- name: debian | Pinning K8s Version - template: - src: etc/apt/preferences.d/k8s.pref.j2 - dest: /etc/apt/preferences.d/k8s.pref - become: true - register: _k8s_pinned_version - -- name: debian | Updating Apt Cache - apt: - update_cache: true - become: true - when: _k8s_pinned_version['changed'] - -- name: debian | Installing K8s Packages - apt: - name: "{{ item }}" - state: present - become: true - with_items: "{{ k8s_debian_packages }}" diff --git a/roles/ansible-k8s/tasks/helm.yml b/roles/ansible-k8s/tasks/helm.yml deleted file mode 100644 index 4267b05..0000000 --- a/roles/ansible-k8s/tasks/helm.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -- name: helm | Checking If Helm Is Already Installed - stat: - path: "{{ k8s_helm_install_dir }}/helm" - register: _k8s_helm_installed_check - when: inventory_hostname == k8s_master - -- name: helm | Checking Installed Version Of Helm (If Installed) - shell: > - helm version | grep -o SemVer:.* | sed 's|:| |g' \ - | sed 's|,||g' | awk '{print $2}' | sed 's|\"||g' \ - | sed 's|v||g' - register: _k8s_helm_installed_version - changed_when: false - when: > - inventory_hostname == k8s_master and - _k8s_helm_installed_check['stat']['exists'] - -- name: helm | Setting Installed Version Of Helm - set_fact: - _k8s_helm_version_installed: "{{ hostvars[inventory_hostname]['_k8s_helm_installed_version']['stdout_lines'][0] }}" - when: > - inventory_hostname == k8s_master and - _k8s_helm_installed_check['stat']['exists'] - -- debug: var=_k8s_helm_version_installed - when: > - inventory_hostname == k8s_master and - _k8s_helm_installed_check['stat']['exists'] - -- name: helm | Installing Helm - unarchive: - src: "{{ k8s_helm_url }}/{{ k8s_helm_package }}" - dest: "{{ k8s_helm_install_dir }}" - # creates: "{{ k8s_helm_install_dir }}/helm" - remote_src: true - register: _k8s_helm_installed - become: true - when: > - (inventory_hostname == k8s_master) and - (not _k8s_helm_installed_check['stat']['exists'] or - (_k8s_helm_installed_check['stat']['exists'] and - _k8s_helm_version_installed != k8s_helm_version)) - -- name: helm | Copying Helm - copy: - src: "{{ k8s_helm_install_dir }}/linux-{{ k8s_helm_architecture }}/helm" - dest: "{{ k8s_helm_install_dir }}/" - remote_src: true - become: true - when: > - (inventory_hostname == k8s_master) and - _k8s_helm_installed['changed'] - -- name: helm | Ensuring Helm Is Executable - file: - dest: "{{ k8s_helm_install_dir }}/helm" - mode: u=rwx,g=rx,o=rx - become: true - when: inventory_hostname == k8s_master - -- name: helm | Cleaning Up Helm Install - file: - dest: "{{ k8s_helm_install_dir }}/linux-{{ k8s_helm_architecture }}" - state: absent - become: true - when: inventory_hostname == k8s_master - -# kubectl create serviceaccount --namespace kube-system tiller -# kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller -# kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' -# helm init --service-account tiller --upgrade - -- name: helm | Initializing Helm - command: helm init - args: - creates: "/home/{{ item['user'] }}/.helm" - become: true - become_user: "{{ item['user'] }}" - with_items: "{{ k8s_users }}" - when: inventory_hostname == k8s_master diff --git a/roles/ansible-k8s/tasks/init_cluster.yml b/roles/ansible-k8s/tasks/init_cluster.yml deleted file mode 100644 index 352679a..0000000 --- a/roles/ansible-k8s/tasks/init_cluster.yml +++ /dev/null @@ -1,122 +0,0 @@ ---- -# We look for this currently just as a check to ensure cluster has been -# initialized or not. This should probably change. -- name: init_cluster | Checking If Cluster Is Already Initialized - stat: - path: "{{ k8s_admin_config }}" - tags: - - k8s_get_dashboard - register: _k8s_kubectl_cluster_info - when: inventory_hostname == k8s_master - -- name: init_cluster | Setting State Of Cluster On Master - set_fact: - k8s_cluster_init: false - tags: - - k8s_get_dashboard - when: > - (inventory_hostname == k8s_master) and - not _k8s_kubectl_cluster_info['stat']['exists'] - -- name: init_cluster | Setting State Of Cluster On Master - set_fact: - k8s_cluster_init: true - tags: - - k8s_get_dashboard - when: > - (inventory_hostname == k8s_master) and - _k8s_kubectl_cluster_info['stat']['exists'] - -- name: init_cluster | Setting State Of Cluster On Non-Master(s) - set_fact: - k8s_cluster_init: "{{ hostvars[k8s_master]['k8s_cluster_init'] }}" - when: inventory_hostname != k8s_master - -- name: init_cluster | Showing Status Of Cluster Fact - debug: msg="Cluster already initialized == {{ k8s_cluster_init }}" - -- name: init_cluster | Generating Token - command: kubeadm token generate - register: _k8s_token - changed_when: false - no_log: true - when: > - (inventory_hostname == k8s_master) and - not k8s_cluster_init - -- name: init_cluster | Setting Token On Master - set_fact: - k8s_token: "{{ _k8s_token['stdout_lines'][0] }}" - no_log: true - when: > - (inventory_hostname == k8s_master) and - not k8s_cluster_init - -- name: init_cluster | Setting Token On Non-Master(s) - set_fact: - k8s_token: "{{ hostvars[k8s_master]['k8s_token'] }}" - no_log: true - when: > - (inventory_hostname != k8s_master) and - not k8s_cluster_init - -# - name: init_cluster | Saving Token On Master -# template: -# src: k8s_token.j2 -# dest: "{{ k8s_token_file }}" -# owner: root -# group: root -# mode: u=rw,g=r,o= -# become: true -# when: > -# (inventory_hostname == k8s_master) and -# not k8s_cluster_init - -- name: init_cluster | Initializing Cluster Master - command: > - kubeadm init \ - --apiserver-advertise-address \ - {{ hostvars[inventory_hostname]['k8s_advertise_address'] }} \ - --apiserver-bind-port \ - {{ k8s_advertise_bind_port }} \ - --token {{ k8s_token }} - register: _k8s_cluster_master_init - become: true - no_log: true - when: > - (inventory_hostname == k8s_master) and - not k8s_cluster_init - -##### Below is commented out as I do not think this is any longer needed and was -##### used for the template only...Causes failures in it's current state after -##### initial cluster is built. This is because we generate a token which is not -##### saved to the cluster. Might have to use kubeadm token create instead. - - -# - name: init_cluster | Capturing Existing Bootstrap Token -# shell: > -# kubeadm --kubeconfig {{ k8s_admin_config }} \ -# token list | grep -v TOKEN | grep 'bootstrap token' | awk '{print $1}' -# register: _k8s_bootstrap_token -# become: true -# no_log: true -# changed_when: false -# when: > -# (inventory_hostname == k8s_master) and -# k8s_cluster_init -# -# - name: init_cluster | Setting Token On Master -# set_fact: -# k8s_token: "{{ _k8s_bootstrap_token['stdout_lines'][0] }}" -# no_log: true -# when: > -# (inventory_hostname == k8s_master) and -# k8s_cluster_init -# -# - name: init_cluster | Setting Token On Non-Master(s) -# set_fact: -# k8s_token: "{{ hostvars[k8s_master]['k8s_token'] }}" -# no_log: true -# when: > -# (inventory_hostname != k8s_master) and -# k8s_cluster_init diff --git a/roles/ansible-k8s/tasks/join_cluster.yml b/roles/ansible-k8s/tasks/join_cluster.yml deleted file mode 100644 index e955d8a..0000000 --- a/roles/ansible-k8s/tasks/join_cluster.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: join_cluster | Joining Additional Nodes To K8s Cluster - command: > - kubeadm join \ - --token {{ k8s_token }} \ - --discovery-token-unsafe-skip-ca-verification \ - {{ hostvars[k8s_master]['k8s_advertise_address'] }}:{{ k8s_advertise_bind_port }} - args: - creates: /etc/kubernetes/kubelet.conf - become: true - no_log: true - when: > - not k8s_cluster_init and - k8s_cluster_init_skip_ca_verification - -- name: join_cluster | Joining Additional Nodes To K8s Cluster - command: > - kubeadm join \ - --token {{ k8s_token }} \ - {{ hostvars[k8s_master]['k8s_advertise_address'] }}:{{ k8s_advertise_bind_port }} - args: - creates: /etc/kubernetes/kubelet.conf - become: true - no_log: true - when: > - not k8s_cluster_init and - not k8s_cluster_init_skip_ca_verification diff --git a/roles/ansible-k8s/tasks/main.yml b/roles/ansible-k8s/tasks/main.yml deleted file mode 100644 index 2314071..0000000 --- a/roles/ansible-k8s/tasks/main.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -# tasks file for ansible-k8s - -- include_tasks: set_facts.yml - tags: - - k8s_cluster_ip - - k8s_cluster_nodes - - k8s_cluster_services - - k8s_dashboard - - k8s_get_dashboard - - k8s_helm - - k8s_pods - -- include_tasks: debian.yml - when: ansible_os_family == "Debian" - -- include_tasks: services.yml - -- include_tasks: swap.yml - -- include_tasks: init_cluster.yml - tags: - - k8s_cluster_services - - k8s_pods - -- include_tasks: network.yml - -- include_tasks: join_cluster.yml - when: inventory_hostname != k8s_master - -- include_tasks: cluster_summary.yml - tags: - - k8s_cluster_nodes - -- include_tasks: users.yml - -- include_tasks: pods.yml - tags: - - k8s_pods - when: > - (inventory_hostname == k8s_master) and - k8s_cluster_init - -- include_tasks: cluster_services.yml - tags: - - k8s_cluster_services - when: > - (inventory_hostname == k8s_master) and - k8s_cluster_init - -- include_tasks: dashboard.yml - tags: - - k8s_dashboard - - k8s_get_dashboard - -- include_tasks: helm.yml - tags: - - k8s_helm - when: k8s_helm_install - -- include_tasks: reset_cluster.yml - when: k8s_reset_cluster diff --git a/roles/ansible-k8s/tasks/network.yml b/roles/ansible-k8s/tasks/network.yml deleted file mode 100644 index 733d282..0000000 --- a/roles/ansible-k8s/tasks/network.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -- name: network | Applying Pod Network - shell: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - apply -f {{ k8s_pod_network_config }} - become: true - register: _k8s_pod_network_applied - when: > - (inventory_hostname == k8s_master) and - not k8s_cluster_init - -- name: network | Waiting For Kube-DNS or CoreDNS To Be Running - shell: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - get pods --all-namespaces | grep -e kube-dns -e coredns - become: true - register: _k8s_kube_dns_running - until: ("Running" in _k8s_kube_dns_running['stdout']) - retries: 30 - delay: 10 - changed_when: false - when: > - (inventory_hostname == k8s_master) - -- debug: msg="Kube-DNS or CoreDNS Is Up and Running" - when: > - (inventory_hostname == k8s_master) and - ("Running" in _k8s_kube_dns_running['stdout']) - -- name: network | Capturing Cluster-IP On Master - command: "kubectl --kubeconfig {{ k8s_admin_config }} get svc -o json" - register: _k8s_cluster_ip - become: true - changed_when: false - tags: - - k8s_cluster_ip - when: inventory_hostname == k8s_master - -- name: network | Setting Cluster-IP On Master - set_fact: - k8s_cluster_ip: "{{ (_k8s_cluster_ip['stdout']|from_json)['items'][0]['spec']['clusterIP'] }}" - tags: - - k8s_cluster_ip - when: inventory_hostname == k8s_master - -- name: network | Setting Cluster-IP On Non-Master(s) - set_fact: - k8s_cluster_ip: "{{ hostvars[k8s_master]['k8s_cluster_ip'] }}" - tags: - - k8s_cluster_ip - when: inventory_hostname != k8s_master - -- name: network | Showing Cluster-IP - debug: var=k8s_cluster_ip - tags: - - k8s_cluster_ip - -- name: network | Checking For Cluster-IP Route On Hosts - shell: "route -n | awk '{print $1}' | grep {{ k8s_cluster_ip }}" - become: true - register: _k8s_cluster_ip_route - failed_when: "(_k8s_cluster_ip_route['rc'] > 1)" - changed_when: false - tags: - - k8s_cluster_ip - when: inventory_hostname != k8s_master - -- name: network | Setting IP Route To Reach Cluster-IP On Master - command: > - route add {{ k8s_cluster_ip }} gw \ - {{ hostvars[k8s_master]['k8s_advertise_address'] }} - become: true - when: > - inventory_hostname != k8s_master and - _k8s_cluster_ip_route['rc'] == 1 - tags: - - k8s_cluster_ip diff --git a/roles/ansible-k8s/tasks/pods.yml b/roles/ansible-k8s/tasks/pods.yml deleted file mode 100644 index ccbb11c..0000000 --- a/roles/ansible-k8s/tasks/pods.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: pods | Capture Pods In All Namespaces - command: > - kubectl --kubeconfig {{ k8s_admin_config }} \ - get pods --all-namespaces -o json - register: _k8s_pods_all_namespaces - become: true - changed_when: false - when: k8s_reports['all_pod_namespaces'] - -- name: pods | Displaying Pods In All Namespaces - debug: - msg: "{{ lookup('template', 'k8s_pods.j2') }}" - when: k8s_reports['all_pod_namespaces'] diff --git a/roles/ansible-k8s/tasks/reset_cluster.yml b/roles/ansible-k8s/tasks/reset_cluster.yml deleted file mode 100644 index 4a68831..0000000 --- a/roles/ansible-k8s/tasks/reset_cluster.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: reset_cluster | Resetting Cluster - command: kubeadm reset - become: true - tags: - - k8s_reset - when: > - k8s_reset_cluster and - inventory_hostname in groups[k8s_cluster_group] diff --git a/roles/ansible-k8s/tasks/services.yml b/roles/ansible-k8s/tasks/services.yml deleted file mode 100644 index c9fa7fe..0000000 --- a/roles/ansible-k8s/tasks/services.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: services | Ensuring All Services Are Started And Enabled On Boot - service: - name: "{{ item }}" - enabled: true - state: started - become: true - with_items: "{{ k8s_services }}" diff --git a/roles/ansible-k8s/tasks/set_facts.yml b/roles/ansible-k8s/tasks/set_facts.yml deleted file mode 100644 index 2404153..0000000 --- a/roles/ansible-k8s/tasks/set_facts.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: set_facts | Setting K8s Master - set_fact: - k8s_master: "{{ groups[k8s_cluster_group][0] }}" - tags: - - k8s_get_dashboard - -- name: set_facts | Showing K8s Master - debug: var=k8s_master - -- name: set_facts | Setting K8s Advertise Address - set_fact: - k8s_advertise_address: "{{ hostvars[inventory_hostname]['ansible_' + k8s_advertise_address_int]['ipv4']['address'] }}" - tags: - - k8s_get_dashboard - -- name: set_facts | Showing K8s Advertise Address - debug: var=k8s_advertise_address diff --git a/roles/ansible-k8s/tasks/swap.yml b/roles/ansible-k8s/tasks/swap.yml deleted file mode 100644 index c061cd7..0000000 --- a/roles/ansible-k8s/tasks/swap.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: swap | Removing swapfile From /etc/fstab - mount: - name: swap - fstype: swap - state: absent - become: true - -- name: swap | Disabling Swap - command: swapoff -a - become: true diff --git a/roles/ansible-k8s/tasks/users.yml b/roles/ansible-k8s/tasks/users.yml deleted file mode 100644 index b4f6b80..0000000 --- a/roles/ansible-k8s/tasks/users.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# We ensure that the folder exists to copy the {{ k8s_admin_config }} to the -# users (defined in k8s_users) home/.kube -- name: users | Ensuring Users home/user/.kube Exists - file: - path: "/home/{{ item['user'] }}/.kube" - owner: "{{ item['user'] }}" - group: "{{ item['user'] }}" - state: directory - become: true - with_items: "{{ k8s_users }}" - when: inventory_hostname == k8s_master - -# We copy the {{ k8s_admin_config }} to the -# users (defined in k8s_users) home/.kube/config -# This allows the user(s) to execute kubectl commands -- name: users | Copying {{ k8s_admin_config }} To Users home/user/.kube/config - copy: - src: "{{ k8s_admin_config }}" - dest: "/home/{{ item['user'] }}/.kube/config" - remote_src: true - owner: "{{ item['user'] }}" - group: "{{ item['user'] }}" - become: true - with_items: "{{ k8s_users }}" - when: inventory_hostname == k8s_master diff --git a/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 b/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 deleted file mode 100644 index 2ca34ed..0000000 --- a/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 +++ /dev/null @@ -1,11 +0,0 @@ -Package: kubeadm -Pin: version {{ k8s_version }}* -Pin-Priority: 900 - -Package: kubectl -Pin: version {{ k8s_version }}* -Pin-Priority: 900 - -Package: kubelet -Pin: version {{ k8s_version }}* -Pin-Priority: 900 diff --git a/roles/ansible-k8s/templates/k8s_cluster_ip.j2 b/roles/ansible-k8s/templates/k8s_cluster_ip.j2 deleted file mode 100644 index 574f2f5..0000000 --- a/roles/ansible-k8s/templates/k8s_cluster_ip.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ (_k8s_cluster_ip['stdout']|from_json)['items'][0]['spec']['clusterIP'] }} diff --git a/roles/ansible-k8s/templates/k8s_dashboard.j2 b/roles/ansible-k8s/templates/k8s_dashboard.j2 deleted file mode 100644 index 9b95896..0000000 --- a/roles/ansible-k8s/templates/k8s_dashboard.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{% if _k8s_get_services_all is defined and k8s_reports['display_dashboard_link'] %} -{% for item in (_k8s_get_services_all['stdout']|from_json)['items'] %} -{% if item['metadata']['name'] == 'kubernetes-dashboard' %} -Kubernetes Dashboard Can be reached at: http://{{ hostvars[k8s_master]['k8s_advertise_address'] }}:{{ item['spec']['ports'][0]['targetPort'] }} -{% endif %} -{% endfor %} -{% endif %} diff --git a/roles/ansible-k8s/templates/k8s_pods.j2 b/roles/ansible-k8s/templates/k8s_pods.j2 deleted file mode 100644 index ca9a469..0000000 --- a/roles/ansible-k8s/templates/k8s_pods.j2 +++ /dev/null @@ -1,18 +0,0 @@ -{% if _k8s_pods_all_namespaces is defined and k8s_reports['all_pod_namespaces'] %} -{% set containers = {} %} -{% set _containers = [] %} -{% for item in (_k8s_pods_all_namespaces['stdout']|from_json)['items'] %} -{% set _container = {} %} -{% set _node = item['spec']['nodeName'] %} -{% set _hostip = item['status']['hostIP'] %} -{% set _podip = item['status']['podIP'] %} -{% set _phase = item['status']['phase'] %} -{% set _container_name = item['spec']['containers'][0]['name'] %} -{% set _container_image = item['spec']['containers'][0]['image'] %} -{% set _container_resources = item['spec']['containers'][0]['resources'] %} -{% set _cont = _container.update({"phase": _phase, "podIP": _podip, "hostIP": _hostip, "name": _container_name, "image": _container_image, "resources": _container_resources, "nodeName": _node}) %} -{% set _cont = _containers.append(_container) %} -{% endfor %} -{% set _cont = containers.update({"containers": _containers}) %} -{{ containers|to_nice_json }} -{% endif %} diff --git a/roles/ansible-k8s/templates/k8s_services.j2 b/roles/ansible-k8s/templates/k8s_services.j2 deleted file mode 100644 index 0f82c61..0000000 --- a/roles/ansible-k8s/templates/k8s_services.j2 +++ /dev/null @@ -1,16 +0,0 @@ -{% if _k8s_get_services_all is defined and k8s_reports['all_service_namespaces'] %} -{% set services = {} %} -{% set _services = [] %} -{% for item in (_k8s_get_services_all['stdout']|from_json)['items'] %} -{% set _service = {} %} -{% set _service_clusterip = item['spec']['clusterIP'] %} -{% set _service_labels = item['metadata']['labels'] %} -{% set _service_name = item['metadata']['name'] %} -{% set _service_namespace = item['metadata']['namespace'] %} -{% set _service_ports = item['spec']['ports'] %} -{% set _svc = _service.update({"clusterIP": _service_clusterip, "labels": _service_labels, "name": _service_name, "namespace": _service_namespace, "ports": _service_ports}) %} -{% set _svc = _services.append(_service) %} -{% endfor %} -{% set _svc = services.update({"services": _services}) %} -{{ services|to_nice_json }} -{% endif %} diff --git a/roles/ansible-k8s/templates/k8s_token.j2 b/roles/ansible-k8s/templates/k8s_token.j2 deleted file mode 100644 index f9c328f..0000000 --- a/roles/ansible-k8s/templates/k8s_token.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ k8s_token }} diff --git a/roles/ansible-k8s/tests/inventory b/roles/ansible-k8s/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/ansible-k8s/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/ansible-k8s/tests/test.yml b/roles/ansible-k8s/tests/test.yml deleted file mode 100644 index 2d51f9f..0000000 --- a/roles/ansible-k8s/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-k8s \ No newline at end of file diff --git a/roles/ansible-k8s/vars/main.yml b/roles/ansible-k8s/vars/main.yml deleted file mode 100644 index 4b293d4..0000000 --- a/roles/ansible-k8s/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-k8s \ No newline at end of file diff --git a/roles/ansible-ntp b/roles/ansible-ntp new file mode 160000 index 0000000..1c57184 --- /dev/null +++ b/roles/ansible-ntp @@ -0,0 +1 @@ +Subproject commit 1c57184ba516f873b7a7440ff4fd448ac0c6c659 diff --git a/roles/ansible-ntp/.travis.yml b/roles/ansible-ntp/.travis.yml deleted file mode 100644 index 43aaf08..0000000 --- a/roles/ansible-ntp/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: required - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - - ansible-playbook tests/test.yml -i tests/inventory - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-ntp/README.md b/roles/ansible-ntp/README.md deleted file mode 100644 index 84c689e..0000000 --- a/roles/ansible-ntp/README.md +++ /dev/null @@ -1,74 +0,0 @@ -Role Name -========= - -An [Ansible] role to install/configure NTP - -Build Status ------------- - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-ntp.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-ntp) - -Requirements ------------- - -Define ntp_master for your group of servers which should be used for your -internal ntp servers for clients to connect to. -ex. group_vars/ntp_masters - -Role Variables --------------- - -``` ---- -# defaults file for ansible-ntp -# Defines if host is ntp_master -# set ntp_master to true on specific group_vars/group -ntp_master: false - -# Define your ntp_master_servers -ntp_master_servers: - - 0.ubuntu.pool.ntp.org - - 1.ubuntu.pool.ntp.org - - 2.ubuntu.pool.ntp.org - - 3.ubuntu.pool.ntp.org - -# Defines your primary domain name (FQDN) -ntp_pri_domain_name: 'example.org' - -# Defines internal ntp servers for clients to poll -# ntp_servers: -# - 'ntp1.{{ ntp_pri_domain_name }}' -# - 'ntp2.{{ ntp_pri_domain_name }}' -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` -- hosts: all - become: true - vars: - roles: - - role: ansible-ntp - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-ntp/defaults/main.yml b/roles/ansible-ntp/defaults/main.yml deleted file mode 100644 index ea16ccc..0000000 --- a/roles/ansible-ntp/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# defaults file for ansible-ntp -# Defines if host is ntp_master -# set ntp_master to true on specific group_vars/group -ntp_master: false - -# Define your ntp_master_servers -ntp_master_servers: - - 0.ubuntu.pool.ntp.org - - 1.ubuntu.pool.ntp.org - - 2.ubuntu.pool.ntp.org - - 3.ubuntu.pool.ntp.org - -# Defines your primary domain name (FQDN) -ntp_pri_domain_name: 'example.org' - -# Defines internal ntp servers for clients to poll -# ntp_servers: -# - 'ntp1.{{ ntp_pri_domain_name }}' -# - 'ntp2.{{ ntp_pri_domain_name }}' diff --git a/roles/ansible-ntp/handlers/main.yml b/roles/ansible-ntp/handlers/main.yml deleted file mode 100644 index 8565161..0000000 --- a/roles/ansible-ntp/handlers/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# handlers file for ansible-ntp -- name: restart ntp - service: - name: "ntp" - state: "restarted" - become: true - when: not ansible_check_mode - -- name: restart ntpd - service: - name: "ntpd" - state: "restarted" - become: true - when: not ansible_check_mode diff --git a/roles/ansible-ntp/meta/.galaxy_install_info b/roles/ansible-ntp/meta/.galaxy_install_info deleted file mode 100644 index 6861a37..0000000 --- a/roles/ansible-ntp/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:48 2018', version: ''} diff --git a/roles/ansible-ntp/meta/main.yml b/roles/ansible-ntp/meta/main.yml deleted file mode 100644 index f16ea9c..0000000 --- a/roles/ansible-ntp/meta/main.yml +++ /dev/null @@ -1,136 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to install/configure NTP - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - # - all - # - etch - - jessie - # - lenny - # - squeeze - - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - - networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-ntp/tasks/debian.yml b/roles/ansible-ntp/tasks/debian.yml deleted file mode 100644 index 81de783..0000000 --- a/roles/ansible-ntp/tasks/debian.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: debian | installing packages - apt: - name: "{{ item }}" - state: "present" - become: true - with_items: - - 'ntp' - -- name: debian | configuring ntp - template: - src: "etc/ntp.conf.j2" - dest: "/etc/ntp.conf" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - notify: restart ntp - become: true diff --git a/roles/ansible-ntp/tasks/main.yml b/roles/ansible-ntp/tasks/main.yml deleted file mode 100644 index fe065f4..0000000 --- a/roles/ansible-ntp/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# tasks file for ansible-ntp -- include: debian.yml - tags: - - config_ntp - when: ansible_os_family == "Debian" - -- include: redhat.yml - tags: - - config_ntp - when: ansible_os_family == "RedHat" diff --git a/roles/ansible-ntp/tasks/redhat.yml b/roles/ansible-ntp/tasks/redhat.yml deleted file mode 100644 index 74826bd..0000000 --- a/roles/ansible-ntp/tasks/redhat.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: redhat | installing packages - yum: - name: "{{ item }}" - state: "present" - become: true - with_items: - - ntp - when: > - ansible_distribution != "Fedora" - -- name: redhat | installing packages - dnf: - name: "{{ item }}" - state: "present" - become: true - with_items: - - ntp - when: > - ansible_distribution == "Fedora" - -- name: redhat | configuring ntp - template: - src: "etc/ntp.conf.j2" - dest: "/etc/ntp.conf" - owner: "root" - group: "root" - mode: "u=rw,g=r,o=r" - become: true - notify: restart ntpd - -- name: redhat | ensuring ntpd service is started and enabled on boot - service: - name: "ntpd" - state: "started" - enabled: yes - become: true diff --git a/roles/ansible-ntp/templates/etc/ntp.conf.j2 b/roles/ansible-ntp/templates/etc/ntp.conf.j2 deleted file mode 100644 index f8c0500..0000000 --- a/roles/ansible-ntp/templates/etc/ntp.conf.j2 +++ /dev/null @@ -1,35 +0,0 @@ -driftfile /var/lib/ntp/ntp.drift -statistics loopstats peerstats clockstats -filegen loopstats file loopstats type day enable -filegen peerstats file peerstats type day enable -filegen clockstats file clockstats type day enable -{% if ntp_master %} -{% if ntp_master_servers is defined %} -{% for server in ntp_master_servers %} -server {{ server }} -{% endfor %} -# Below 127.127.1.1 setting refer to the system time on the current machine in -# case of network isolation. -server 127.127.1.1 -fudge 127.127.1.1 stratum 5 -{% endif %} -{% endif %} -{% if not ntp_master %} -{% if ntp_servers is defined %} -{% for server in ntp_servers %} -server {{ server }} -{% endfor %} -{% endif %} -{% if ntp_servers is not defined %} -server 0.ubuntu.pool.ntp.org -server 1.ubuntu.pool.ntp.org -server 2.ubuntu.pool.ntp.org -server 3.ubuntu.pool.ntp.org -{% endif %} -{% endif %} -# Use Ubuntu's ntp server as a fallback. -server ntp.ubuntu.com -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery -restrict 127.0.0.1 -restrict ::1 diff --git a/roles/ansible-ntp/tests/inventory b/roles/ansible-ntp/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-ntp/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-ntp/tests/test.yml b/roles/ansible-ntp/tests/test.yml deleted file mode 100644 index d0bd082..0000000 --- a/roles/ansible-ntp/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: localhost - remote_user: root - connection: local - roles: - - ansible-ntp diff --git a/roles/ansible-ntp/vars/main.yml b/roles/ansible-ntp/vars/main.yml deleted file mode 100644 index 212a789..0000000 --- a/roles/ansible-ntp/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-ntp diff --git a/roles/ansible-sshd b/roles/ansible-sshd new file mode 160000 index 0000000..b28d674 --- /dev/null +++ b/roles/ansible-sshd @@ -0,0 +1 @@ +Subproject commit b28d6741aa9afbfe162504ec406fb8811e586fec diff --git a/roles/ansible-sshd/.travis.yml b/roles/ansible-sshd/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/roles/ansible-sshd/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/roles/ansible-sshd/README.md b/roles/ansible-sshd/README.md deleted file mode 100644 index 066216c..0000000 --- a/roles/ansible-sshd/README.md +++ /dev/null @@ -1,277 +0,0 @@ -Role Name -========= - -An [Ansible] role to install/configure [SSHD] -- Obviously [SSHD] is already installed if managing remotely with [Ansible]. -However, using `ansible-pull` could benefit from this and/or manually running -this playbook on a system to install [SSHD]. The configuration ability is -useful in any manner. - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-sshd -# all variables with yes or no must be defined as such including wrapping them -# in '' to ensure the variable is not converted to a boolean - -# Specifies what environment variables sent by the client will be copied into -# the session's environ(7) -sshd_accept_env: 'LANG LC_*' - -# This keyword can be followed by a list of group name patterns, separated by -# spaces. If specified, login is allowed only for users whose primary group or -# supplementary group list matches one of the patterns. Only group names are -# valid; a numerical group ID is not recognized. By default, login is allowed -# for all groups. The allow/deny directives are processed in the following -# order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups. -sshd_allow_groups: [] - # - 'adm' - # - 'ssh_users' - -# This keyword can be followed by a list of user name patterns, separated by -# spaces. If specified, login is allowed only for user names that match one of -# the patterns. Only user names are valid; a numerical user ID is not -# recognized. By default, login is allowed for all users. If the pattern -# takes the form USER@HOST then USER and HOST are separately checked, -# restricting logins to particular users from particular hosts. HOST criteria -# may additionally contain addresses to match in CIDR address/masklen format. -# The allow/deny directives are processed in the following order: DenyUsers, -# AllowUsers, DenyGroups, and finally AllowGroups. -sshd_allow_users: [] - # - 'vagrant' - # - 'admin' - -# Specifies whether TCP forwarding is permitted. The available options are -# yes (the default) or all to allow TCP forwarding, no to prevent all TCP -# forwarding, local to allow local (from the perspective of ssh(1)) forwarding -# only or remote to allow remote forwarding only. Note that disabling TCP -# forwarding does not improve security unless users are also denied shell -# access, as they can always install their own forwarders. -sshd_allow_tcp_forwarding: 'yes' - -# Specifies the file that contains the public keys used for user authentication. -# Alternately this option may be set to none to skip checking for user keys in -# files. -# The default is “.ssh/authorized_keys .ssh/authorized_keys2” -sshd_authorized_keys_file: '%h/.ssh/authorized_keys' - -# The contents of the specified file are sent to the remote user before -# authentication is allowed. If the argument is none then no banner is -# displayed. By default, no banner is displayed. -sshd_banner: [] - -# Specifies whether challenge-response authentication is allowed. All -# authentication styles from login.conf(5) are supported. The default is yes. -sshd_challenge_response_authentication: 'yes' - -# Specifies whether compression is enabled after the user has authenticated -# successfully. The argument must be yes, delayed (a legacy synonym for yes) -# or no. The default is yes -sshd_compression: 'yes' - -sshd_config: true - -# This keyword can be followed by a list of group name patterns, separated by -# spaces. Login is disallowed for users whose primary group or supplementary -# group list matches one of the patterns. Only group names are valid; a -# numerical group ID is not recognized. By default, login is allowed for -# all groups. The allow/deny directives are processed in the following -# order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups. -sshd_deny_groups: [] - # - 'badguys' - -# This keyword can be followed by a list of user name patterns, separated by -# spaces. Login is disallowed for user names that match one of the patterns. -# Only user names are valid; a numerical user ID is not recognized. -# By default, login is allowed for all users. If the pattern takes the form -# USER@HOST then USER and HOST are separately checked, restricting logins to -# particular users from particular hosts. HOST criteria may additionally -# contain addresses to match in CIDR address/masklen format. The allow/deny -# directives are processed in the following order: DenyUsers, AllowUsers, -# DenyGroups, and finally AllowGroups. -sshd_deny_users: [] - # - 'baduser' - -# Specifies whether user authentication based on GSSAPI is allowed. -# The default is no. -sshd_gssapi_authentication: 'no' - -# Specifies whether to automatically destroy the user's credentials cache on -# logout. The default is yes. -sshd_gssapi_cleanup_credentials: 'yes' - -# Specifies whether rhosts or /etc/hosts.equiv authentication together with -# successful public key client host authentication is allowed -# (host-based authentication). The default is no. -sshd_host_based_authentication: 'no' - -# Specifies a file containing a private host key used by SSH. -# The defaults are /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key, -# /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key. -sshd_host_keys: - - '/etc/ssh/ssh_host_rsa_key' - - '/etc/ssh/ssh_host_dsa_key' - - '/etc/ssh/ssh_host_ecdsa_key' - - '/etc/ssh/ssh_host_ed25519_key' - -# Specifies that .rhosts and .shosts files will not be used in HostbasedAuthentication. -# /etc/hosts.equiv and /etc/shosts.equiv are still used. The default is yes. -sshd_ignore_rhosts: 'yes' - -# Specifies whether sshd(8) should ignore the user's ~/.ssh/known_hosts during -# HostbasedAuthentication. The default is no. -sshd_ignore_user_known_hosts: 'no' - -sshd_key_regeneration_interval: '3600' - -# Specifies the local addresses sshd(8) should listen on -sshd_listen_addresses: - - '0.0.0.0' - - '::' - -# Gives the verbosity level that is used when logging messages from sshd(8). -# The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, -# DEBUG2, and DEBUG3. The default is INFO. DEBUG and DEBUG1 are equivalent. -# DEBUG2 and DEBUG3 each specify higher levels of debugging output. -# Logging with a DEBUG level violates the privacy of users and is not recommended. -sshd_log_level: 'INFO' - -# The server disconnects after this time if the user has not successfully -# logged in. If the value is 0, there is no time limit. -# The default is 120 seconds. -sshd_login_grace_time: '120' - -# Specifies the maximum number of concurrent unauthenticated connections to -# the SSH daemon. Additional connections will be dropped until authentication -# succeeds or the LoginGraceTime expires for a connection. -# The default is 10:30:100. -sshd_max_startups: '10:30:100' - -# Specifies whether password authentication is allowed. The default is yes -sshd_password_authentication: 'yes' - -# When password authentication is allowed, it specifies whether the server -# allows login to accounts with empty password strings. The default is no. -sshd_permit_empty_passwords: 'no' - -# Specifies whether root can log in using ssh(1). The argument must be yes, -# prohibit-password, without-password, forced-commands-only, or no. -# The default is prohibit-password. -sshd_permit_root_login: 'no' - -# Specifies the port number that sshd(8) listens on. The default is 22. -sshd_ports: - - '22' - -# Specifies whether sshd(8) should print the date and time of the last user -# login when a user logs in interactively. The default is yes. -sshd_print_lastlog: 'yes' - -# Specifies whether sshd(8) should print /etc/motd when a user logs in -# interactively. (On some systems it is also printed by the shell, /etc/profile, -# or equivalent.) The default is yes. -sshd_print_motd: 'yes' - -sshd_protocol: '2' - -# Specifies whether public key authentication is allowed. The default is yes -sshd_pubkey_authentication: 'yes' - -sshd_rhosts_rsa_authentication: 'no' -sshd_rsa_authentication: 'yes' - -sshd_server_key_bits: '1024' - -# Specifies whether sshd(8) should check file modes and ownership of the -# user's files and home directory before accepting login. This is normally -# desirable because novices sometimes accidentally leave their directory or -# files world-writable. The default is yes -sshd_strict_modes: 'yes' - -# Configures an external subsystem (e.g. file transfer daemon). Arguments -# should be a subsystem name and a command (with optional arguments) to execute -# upon subsystem request. -# The command sftp-server implements the SFTP file transfer subsystem. -# Alternately the name internal-sftp implements an in-process SFTP server. -# This may simplify configurations using ChrootDirectory to force a different -# filesystem root on clients. -# By default no subsystems are defined. -sshd_subsystem: 'sftp /usr/lib/openssh/sftp-server' - -# Gives the facility code that is used when logging messages from sshd(8). -# The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, -# LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. -sshd_syslog_facility: 'AUTH' - -# Specifies whether the system should send TCP keepalive messages to the other -# side. If they are sent, death of the connection or crash of one of the -# machines will be properly noticed. However, this means that connections will -# die if the route is down temporarily, and some people find it annoying. On -# the other hand, if TCP keepalives are not sent, sessions may hang indefinitely -# on the server, leaving “ghost” users and consuming server resources. -# The default is yes (to send TCP keepalive messages), and the server will -# notice if the network goes down or the client host crashes. This avoids -# infinitely hanging sessions. -# To disable TCP keepalive messages, the value should be set to no. -sshd_tcp_keep_alive: 'yes' - -# Specifies whether sshd(8) should look up the remote host name, and to check -# that the resolved host name for the remote IP address maps back to the very -# same IP address. -# If this option is set to no (the default) then only addresses and not host -# names may be used in ~/.ssh/authorized_keys from and sshd_config Match -# Host directives. -sshd_use_dns: 'no' - -sshd_use_pam: 'yes' -sshd_use_privilege_separation: 'yes' - -# Specifies the first display number available for sshd(8)'s X11 forwarding. -# This prevents sshd from interfering with real X11 servers. The default is 10. -sshd_x11_display_offset: '10' - -# Specifies whether X11 forwarding is permitted. The argument must be yes or no. -# The default is no. -sshd_x11_forwarding: 'yes' -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` ---- -- hosts: all - become: true - vars: - roles: - - role: ansible-sshd - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: -[SSHD]: diff --git a/roles/ansible-sshd/defaults/main.yml b/roles/ansible-sshd/defaults/main.yml deleted file mode 100644 index a06db65..0000000 --- a/roles/ansible-sshd/defaults/main.yml +++ /dev/null @@ -1,224 +0,0 @@ ---- -# defaults file for ansible-sshd -# all variables with yes or no must be defined as such including wrapping them -# in '' to ensure the variable is not converted to a boolean - -# Specifies what environment variables sent by the client will be copied into -# the session's environ(7) -sshd_accept_env: 'LANG LC_*' - -# This keyword can be followed by a list of group name patterns, separated by -# spaces. If specified, login is allowed only for users whose primary group or -# supplementary group list matches one of the patterns. Only group names are -# valid; a numerical group ID is not recognized. By default, login is allowed -# for all groups. The allow/deny directives are processed in the following -# order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups. -sshd_allow_groups: [] - # - 'adm' - # - 'ssh_users' - -# This keyword can be followed by a list of user name patterns, separated by -# spaces. If specified, login is allowed only for user names that match one of -# the patterns. Only user names are valid; a numerical user ID is not -# recognized. By default, login is allowed for all users. If the pattern -# takes the form USER@HOST then USER and HOST are separately checked, -# restricting logins to particular users from particular hosts. HOST criteria -# may additionally contain addresses to match in CIDR address/masklen format. -# The allow/deny directives are processed in the following order: DenyUsers, -# AllowUsers, DenyGroups, and finally AllowGroups. -sshd_allow_users: [] - # - 'vagrant' - # - 'admin' - -# Specifies whether TCP forwarding is permitted. The available options are -# yes (the default) or all to allow TCP forwarding, no to prevent all TCP -# forwarding, local to allow local (from the perspective of ssh(1)) forwarding -# only or remote to allow remote forwarding only. Note that disabling TCP -# forwarding does not improve security unless users are also denied shell -# access, as they can always install their own forwarders. -sshd_allow_tcp_forwarding: 'yes' - -# Specifies the file that contains the public keys used for user authentication. -# Alternately this option may be set to none to skip checking for user keys in -# files. -# The default is “.ssh/authorized_keys .ssh/authorized_keys2” -sshd_authorized_keys_file: '%h/.ssh/authorized_keys' - -# The contents of the specified file are sent to the remote user before -# authentication is allowed. If the argument is none then no banner is -# displayed. By default, no banner is displayed. -sshd_banner: [] - -# Specifies whether challenge-response authentication is allowed. All -# authentication styles from login.conf(5) are supported. The default is yes. -sshd_challenge_response_authentication: 'yes' - -# Specifies whether compression is enabled after the user has authenticated -# successfully. The argument must be yes, delayed (a legacy synonym for yes) -# or no. The default is yes -sshd_compression: 'yes' - -sshd_config: true - -# This keyword can be followed by a list of group name patterns, separated by -# spaces. Login is disallowed for users whose primary group or supplementary -# group list matches one of the patterns. Only group names are valid; a -# numerical group ID is not recognized. By default, login is allowed for -# all groups. The allow/deny directives are processed in the following -# order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups. -sshd_deny_groups: [] - # - 'badguys' - -# This keyword can be followed by a list of user name patterns, separated by -# spaces. Login is disallowed for user names that match one of the patterns. -# Only user names are valid; a numerical user ID is not recognized. -# By default, login is allowed for all users. If the pattern takes the form -# USER@HOST then USER and HOST are separately checked, restricting logins to -# particular users from particular hosts. HOST criteria may additionally -# contain addresses to match in CIDR address/masklen format. The allow/deny -# directives are processed in the following order: DenyUsers, AllowUsers, -# DenyGroups, and finally AllowGroups. -sshd_deny_users: [] - # - 'baduser' - -# Specifies whether user authentication based on GSSAPI is allowed. -# The default is no. -sshd_gssapi_authentication: 'no' - -# Specifies whether to automatically destroy the user's credentials cache on -# logout. The default is yes. -sshd_gssapi_cleanup_credentials: 'yes' - -# Specifies whether rhosts or /etc/hosts.equiv authentication together with -# successful public key client host authentication is allowed -# (host-based authentication). The default is no. -sshd_host_based_authentication: 'no' - -# Specifies a file containing a private host key used by SSH. -# The defaults are /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key, -# /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key. -sshd_host_keys: - - '/etc/ssh/ssh_host_rsa_key' - - '/etc/ssh/ssh_host_dsa_key' - - '/etc/ssh/ssh_host_ecdsa_key' - - '/etc/ssh/ssh_host_ed25519_key' - -# Specifies that .rhosts and .shosts files will not be used in HostbasedAuthentication. -# /etc/hosts.equiv and /etc/shosts.equiv are still used. The default is yes. -sshd_ignore_rhosts: 'yes' - -# Specifies whether sshd(8) should ignore the user's ~/.ssh/known_hosts during -# HostbasedAuthentication. The default is no. -sshd_ignore_user_known_hosts: 'no' - -sshd_key_regeneration_interval: '3600' - -# Specifies the local addresses sshd(8) should listen on -sshd_listen_addresses: - - '0.0.0.0' - - '::' - -# Gives the verbosity level that is used when logging messages from sshd(8). -# The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, -# DEBUG2, and DEBUG3. The default is INFO. DEBUG and DEBUG1 are equivalent. -# DEBUG2 and DEBUG3 each specify higher levels of debugging output. -# Logging with a DEBUG level violates the privacy of users and is not recommended. -sshd_log_level: 'INFO' - -# The server disconnects after this time if the user has not successfully -# logged in. If the value is 0, there is no time limit. -# The default is 120 seconds. -sshd_login_grace_time: '120' - -# Specifies the maximum number of concurrent unauthenticated connections to -# the SSH daemon. Additional connections will be dropped until authentication -# succeeds or the LoginGraceTime expires for a connection. -# The default is 10:30:100. -sshd_max_startups: '10:30:100' - -# Specifies whether password authentication is allowed. The default is yes -sshd_password_authentication: 'yes' - -# When password authentication is allowed, it specifies whether the server -# allows login to accounts with empty password strings. The default is no. -sshd_permit_empty_passwords: 'no' - -# Specifies whether root can log in using ssh(1). The argument must be yes, -# prohibit-password, without-password, forced-commands-only, or no. -# The default is prohibit-password. -sshd_permit_root_login: 'no' - -# Specifies the port number that sshd(8) listens on. The default is 22. -sshd_ports: - - '22' - -# Specifies whether sshd(8) should print the date and time of the last user -# login when a user logs in interactively. The default is yes. -sshd_print_lastlog: 'yes' - -# Specifies whether sshd(8) should print /etc/motd when a user logs in -# interactively. (On some systems it is also printed by the shell, /etc/profile, -# or equivalent.) The default is yes. -sshd_print_motd: 'yes' - -sshd_protocol: '2' - -# Specifies whether public key authentication is allowed. The default is yes -sshd_pubkey_authentication: 'yes' - -sshd_rhosts_rsa_authentication: 'no' -sshd_rsa_authentication: 'yes' - -sshd_server_key_bits: '1024' - -# Specifies whether sshd(8) should check file modes and ownership of the -# user's files and home directory before accepting login. This is normally -# desirable because novices sometimes accidentally leave their directory or -# files world-writable. The default is yes -sshd_strict_modes: 'yes' - -# Configures an external subsystem (e.g. file transfer daemon). Arguments -# should be a subsystem name and a command (with optional arguments) to execute -# upon subsystem request. -# The command sftp-server implements the SFTP file transfer subsystem. -# Alternately the name internal-sftp implements an in-process SFTP server. -# This may simplify configurations using ChrootDirectory to force a different -# filesystem root on clients. -# By default no subsystems are defined. -sshd_subsystem: 'sftp /usr/lib/openssh/sftp-server' - -# Gives the facility code that is used when logging messages from sshd(8). -# The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, -# LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. -sshd_syslog_facility: 'AUTH' - -# Specifies whether the system should send TCP keepalive messages to the other -# side. If they are sent, death of the connection or crash of one of the -# machines will be properly noticed. However, this means that connections will -# die if the route is down temporarily, and some people find it annoying. On -# the other hand, if TCP keepalives are not sent, sessions may hang indefinitely -# on the server, leaving “ghost” users and consuming server resources. -# The default is yes (to send TCP keepalive messages), and the server will -# notice if the network goes down or the client host crashes. This avoids -# infinitely hanging sessions. -# To disable TCP keepalive messages, the value should be set to no. -sshd_tcp_keep_alive: 'yes' - -# Specifies whether sshd(8) should look up the remote host name, and to check -# that the resolved host name for the remote IP address maps back to the very -# same IP address. -# If this option is set to no (the default) then only addresses and not host -# names may be used in ~/.ssh/authorized_keys from and sshd_config Match -# Host directives. -sshd_use_dns: 'no' - -sshd_use_pam: 'yes' -sshd_use_privilege_separation: 'yes' - -# Specifies the first display number available for sshd(8)'s X11 forwarding. -# This prevents sshd from interfering with real X11 servers. The default is 10. -sshd_x11_display_offset: '10' - -# Specifies whether X11 forwarding is permitted. The argument must be yes or no. -# The default is no. -sshd_x11_forwarding: 'yes' diff --git a/roles/ansible-sshd/handlers/main.yml b/roles/ansible-sshd/handlers/main.yml deleted file mode 100644 index f642210..0000000 --- a/roles/ansible-sshd/handlers/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# handlers file for ansible-sshd -- name: "restart ssh" - service: - name: "ssh" - state: "restarted" - -- name: "restart sshd" - service: - name: "sshd" - state: "restarted" diff --git a/roles/ansible-sshd/meta/.galaxy_install_info b/roles/ansible-sshd/meta/.galaxy_install_info deleted file mode 100644 index 6861a37..0000000 --- a/roles/ansible-sshd/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:48 2018', version: ''} diff --git a/roles/ansible-sshd/meta/main.yml b/roles/ansible-sshd/meta/main.yml deleted file mode 100644 index 8e3e67d..0000000 --- a/roles/ansible-sshd/meta/main.yml +++ /dev/null @@ -1,222 +0,0 @@ -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to install/configure [SSHD] - # company: your company (optional) - - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - - min_ansible_version: 1.2 - - # Optionally specify the branch Galaxy will use when accessing the GitHub - # repo for this role. During role install, if no tags are available, - # Galaxy will use this branch. During import Galaxy will access files on - # this branch. If travis integration is cofigured, only notification for this - # branch will be accepted. Otherwise, in all cases, the repo's default branch - # (usually master) will be used. - #github_branch: - - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: OpenBSD - # versions: - # - all - # - 5.6 - # - 5.7 - # - 5.8 - # - 5.9 - # - 6.0 - - name: Fedora - versions: - - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - # - 23 - # - 24 - # - 25 - #- name: DellOS - # versions: - # - all - # - 10 - # - 6 - # - 9 - #- name: MacOSX - # versions: - # - all - # - 10.10 - # - 10.11 - # - 10.12 - # - 10.7 - # - 10.8 - # - 10.9 - #- name: Synology - # versions: - # - all - # - any - #- name: Junos - # versions: - # - all - # - any - #- name: GenericBSD - # versions: - # - all - # - any - #- name: Void Linux - # versions: - # - all - # - any - #- name: GenericLinux - # versions: - # - all - # - any - #- name: NXOS - # versions: - # - all - # - any - #- name: IOS - # versions: - # - all - # - any - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - # - 2016.03 - # - 2016.09 - #- name: ArchLinux - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 10.0 - # - 10.1 - # - 10.2 - # - 10.3 - # - 11.0 - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - # - 9.3 - - name: Ubuntu - versions: - - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - # - utopic - # - vivid - # - wily - # - xenial - # - yakkety - - name: Debian - versions: - - all - # - etch - # - jessie - # - lenny - # - sid - # - squeeze - # - stretch - # - wheezy - #- name: Alpine - # versions: - # - all - # - any - - name: EL - versions: - - all - # - 5 - # - 6 - # - 7 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - # - 11SP4 - # - 12 - # - 12SP1 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Solaris - # versions: - # - all - # - 10 - # - 11.0 - # - 11.1 - # - 11.2 - # - 11.3 - #- name: eos - # versions: - # - all - # - Any - - galaxy_tags: - # List tags for your role here, one per line. A tag is - # a keyword that describes and categorizes the role. - # Users find roles by searching for tags. Be sure to - # remove the '[]' above if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of - # alphanumeric characters. Maximum 20 tags per role. - - system -dependencies: [] - # List your role dependencies here, one per line. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-sshd/tasks/config.yml b/roles/ansible-sshd/tasks/config.yml deleted file mode 100644 index 3602cc1..0000000 --- a/roles/ansible-sshd/tasks/config.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: config | Setting Facts - set_fact: - sshd_service: 'ssh' - when: ansible_os_family == "Debian" - -- name: config | Setting Facts - set_fact: - sshd_service: 'sshd' - when: ansible_os_family == "RedHat" - -- name: config | Configuring SSHD - template: - src: "etc/ssh/sshd_config.j2" - dest: "/etc/ssh/sshd_config" - notify: "restart {{ sshd_service }}" diff --git a/roles/ansible-sshd/tasks/debian.yml b/roles/ansible-sshd/tasks/debian.yml deleted file mode 100644 index fa71e9b..0000000 --- a/roles/ansible-sshd/tasks/debian.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# This obviously is already installed if using Ansible -# However, could be useful as an ansible-pull task -- name: debian | Installing SSHD - apt: - name: "openssh-server" - state: "present" diff --git a/roles/ansible-sshd/tasks/main.yml b/roles/ansible-sshd/tasks/main.yml deleted file mode 100644 index b8c0200..0000000 --- a/roles/ansible-sshd/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# tasks file for ansible-sshd -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_os_family == "RedHat" - -- include: config.yml - when: sshd_config diff --git a/roles/ansible-sshd/tasks/redhat.yml b/roles/ansible-sshd/tasks/redhat.yml deleted file mode 100644 index a509398..0000000 --- a/roles/ansible-sshd/tasks/redhat.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# This obviously is already installed if using Ansible -# However, could be useful as an ansible-pull task -- name: redhat | Installing SSHD - dnf: - name: "openssh-server" - state: "present" - when: ansible_distribution == "Fedora" - -- name: redhat | Installing SSHD - yum: - name: "openssh-server" - state: "present" - when: ansible_distribution != "Fedora" diff --git a/roles/ansible-sshd/templates/etc/ssh/sshd_config.j2 b/roles/ansible-sshd/templates/etc/ssh/sshd_config.j2 deleted file mode 100644 index a748338..0000000 --- a/roles/ansible-sshd/templates/etc/ssh/sshd_config.j2 +++ /dev/null @@ -1,57 +0,0 @@ -AcceptEnv {{ sshd_accept_env }} -{% if sshd_allow_groups != [] %} -AllowGroups {{ sshd_allow_groups|join (' ') }} -{% endif %} -AllowTcpForwarding {{ sshd_allow_tcp_forwarding }} -{% if sshd_allow_users != [] %} -AllowUsers {{ sshd_allow_users|join (' ') }} -{% endif %} -AuthorizedKeysFile {{ sshd_authorized_keys_file }} -{% if sshd_banner != [] %} -Banner {{ sshd_banner }} -{% endif %} -ChallengeResponseAuthentication {{ sshd_challenge_response_authentication }} -Compression {{ sshd_compression }} -{% if sshd_deny_groups != [] %} -DenyGroups {{ sshd_deny_groups|join (' ') }} -{% endif %} -{% if sshd_deny_users != [] %} -DenyUsers {{ sshd_deny_users|join (' ') }} -{% endif %} -GSSAPIAuthentication {{ sshd_gssapi_authentication }} -GSSAPICleanupCredentials {{ sshd_gssapi_cleanup_credentials }} -HostbasedAuthentication {{ sshd_host_based_authentication }} -{% for item in sshd_host_keys %} -HostKey {{ item }} -{% endfor %} -IgnoreRhosts {{ sshd_ignore_rhosts }} -IgnoreUserKnownHosts {{ sshd_ignore_user_known_hosts }} -KeyRegenerationInterval {{ sshd_key_regeneration_interval }} -{% for item in sshd_ports %} -Port {{ item }} -{% endfor %} -{% for item in sshd_listen_addresses %} -ListenAddress {{ item }} -{% endfor %} -LoginGraceTime {{ sshd_login_grace_time }} -LogLevel {{ sshd_log_level }} -MaxStartups {{ sshd_max_startups }} -PasswordAuthentication {{ sshd_password_authentication }} -PermitEmptyPasswords {{ sshd_permit_empty_passwords }} -PermitRootLogin {{ sshd_permit_root_login }} -PrintLastLog {{ sshd_print_lastlog }} -PrintMotd {{ sshd_print_motd }} -Protocol {{ sshd_protocol }} -PubkeyAuthentication {{ sshd_pubkey_authentication }} -RhostsRSAAuthentication {{ sshd_rhosts_rsa_authentication }} -RSAAuthentication {{ sshd_rsa_authentication }} -ServerKeyBits {{ sshd_server_key_bits }} -StrictModes {{ sshd_strict_modes }} -Subsystem {{ sshd_subsystem }} -SyslogFacility {{ sshd_syslog_facility }} -TCPKeepAlive {{ sshd_tcp_keep_alive }} -UseDNS {{ sshd_use_dns }} -UsePAM {{ sshd_use_pam }} -UsePrivilegeSeparation {{ sshd_use_privilege_separation }} -X11DisplayOffset {{ sshd_x11_display_offset }} -X11Forwarding {{ sshd_x11_forwarding }} diff --git a/roles/ansible-sshd/tests/inventory b/roles/ansible-sshd/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-sshd/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-sshd/tests/test.yml b/roles/ansible-sshd/tests/test.yml deleted file mode 100644 index 49c3670..0000000 --- a/roles/ansible-sshd/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-sshd \ No newline at end of file diff --git a/roles/ansible-sshd/vars/main.yml b/roles/ansible-sshd/vars/main.yml deleted file mode 100644 index 5ff959f..0000000 --- a/roles/ansible-sshd/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-sshd diff --git a/roles/ansible-timezone b/roles/ansible-timezone new file mode 160000 index 0000000..72eab9c --- /dev/null +++ b/roles/ansible-timezone @@ -0,0 +1 @@ +Subproject commit 72eab9c3ac87759fcbfd4e2b131df8fd949ecf0d diff --git a/roles/ansible-timezone/.travis.yml b/roles/ansible-timezone/.travis.yml deleted file mode 100644 index a6886a3..0000000 --- a/roles/ansible-timezone/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - # Install role - - ansible-playbook tests/test.yml -i tests/inventory --check - # # Check idempotence - # - "ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)" - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/ansible-timezone/README.md b/roles/ansible-timezone/README.md deleted file mode 100644 index 6444d2a..0000000 --- a/roles/ansible-timezone/README.md +++ /dev/null @@ -1,62 +0,0 @@ -Role Name -========= - -An [Ansible] role to configure timezone settings - -Build Status ------------- -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-timezone.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-timezone) - -Requirements ------------- - -None - -Role Variables --------------- - -``` ---- -# defaults file for ansible-timezone - -# set your desired default timezone - -# timezone: 'EST5EDT' -# timezone: 'America/New_York' -timezone: 'UTC' - -timezone_update_hardware_clock: false -``` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -``` ---- -- hosts: all - become: true - vars: - roles: - - role: ansible-timezone - tasks: -``` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com - -[Ansible]: diff --git a/roles/ansible-timezone/defaults/main.yml b/roles/ansible-timezone/defaults/main.yml deleted file mode 100644 index fe3177d..0000000 --- a/roles/ansible-timezone/defaults/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# defaults file for ansible-timezone - -# set your desired default timezone - -# timezone: 'EST5EDT' -# timezone: 'America/New_York' -timezone: 'UTC' - -timezone_update_hardware_clock: false diff --git a/roles/ansible-timezone/handlers/main.yml b/roles/ansible-timezone/handlers/main.yml deleted file mode 100644 index 8053e2f..0000000 --- a/roles/ansible-timezone/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for ansible-timezone -- name: update tzdata - command: "dpkg-reconfigure --frontend noninteractive tzdata" diff --git a/roles/ansible-timezone/meta/.galaxy_install_info b/roles/ansible-timezone/meta/.galaxy_install_info deleted file mode 100644 index 948127c..0000000 --- a/roles/ansible-timezone/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Sat Feb 10 02:40:49 2018', version: ''} diff --git a/roles/ansible-timezone/meta/main.yml b/roles/ansible-timezone/meta/main.yml deleted file mode 100644 index f4d27d5..0000000 --- a/roles/ansible-timezone/meta/main.yml +++ /dev/null @@ -1,133 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: An [Ansible] role to configure timezone settings - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - - name: Fedora - versions: - - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - # - 22 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - # - utopic - # - vivid - # - xenial - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - - name: Debian - versions: - - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/roles/ansible-timezone/tasks/main.yml b/roles/ansible-timezone/tasks/main.yml deleted file mode 100644 index 4425d2d..0000000 --- a/roles/ansible-timezone/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# tasks file for ansible-timezone - -- name: main | Setting Timezone - timezone: - name: "{{ timezone }}" - tags: - - configuration - - timezone - when: not timezone_update_hardware_clock - -- name: main | Setting Timezone And Hardware Clock - timezone: - name: "{{ timezone }}" - hwclock: true - tags: - - configuration - - timezone - when: timezone_update_hardware_clock diff --git a/roles/ansible-timezone/templates/timezone.j2 b/roles/ansible-timezone/templates/timezone.j2 deleted file mode 100644 index 0b6d009..0000000 --- a/roles/ansible-timezone/templates/timezone.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ timezone }} diff --git a/roles/ansible-timezone/tests/inventory b/roles/ansible-timezone/tests/inventory deleted file mode 100644 index 2fbb50c..0000000 --- a/roles/ansible-timezone/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/ansible-timezone/tests/test.yml b/roles/ansible-timezone/tests/test.yml deleted file mode 100644 index 38b05e3..0000000 --- a/roles/ansible-timezone/tests/test.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - connection: local - remote_user: root - vars: - roles: - - role: ansible-timezone - tasks: diff --git a/roles/ansible-timezone/vars/main.yml b/roles/ansible-timezone/vars/main.yml deleted file mode 100644 index 993f6d1..0000000 --- a/roles/ansible-timezone/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-timezone