From 03bf1679b2dd7b921ccd1507bdd92637aa0e8549 Mon Sep 17 00:00:00 2001 From: Ryan Moriarty <24617283+rmoriar1@users.noreply.github.com> Date: Mon, 8 Mar 2021 18:08:31 +0000 Subject: [PATCH] Remove exisiting role, and add new one using submodules --- .gitmodules | 3 + roles/google-cloud-ops-agents-ansible | 1 + roles/stackdriver_logging/README.md | 59 ------------------ roles/stackdriver_logging/defaults/main.yml | 26 -------- roles/stackdriver_logging/handlers/main.yml | 5 -- roles/stackdriver_logging/meta/main.yml | 20 ------- .../molecule/default/.ansible-lint | 6 -- .../molecule/default/.yamllint | 11 ---- .../molecule/default/Dockerfile.j2 | 22 ------- .../molecule/default/molecule.yml | 27 --------- .../molecule/default/playbook.yml | 5 -- .../molecule/default/tests/test_default.py | 17 ------ roles/stackdriver_logging/tasks/debian.yml | 25 -------- roles/stackdriver_logging/tasks/main.yml | 20 ------- roles/stackdriver_logging/tasks/redhat.yml | 20 ------- .../templates/default/google-fluentd | 8 --- .../stackdriver_logging/templates/source.conf | 11 ---- roles/stackdriver_logging/vars/main.yml | 2 - roles/stackdriver_monitoring/README.md | 60 ------------------- .../stackdriver_monitoring/defaults/main.yml | 20 ------- .../stackdriver_monitoring/handlers/main.yml | 5 -- roles/stackdriver_monitoring/meta/main.yml | 20 ------- .../molecule/default/.ansible-lint | 6 -- .../molecule/default/.yamllint | 11 ---- .../molecule/default/Dockerfile.j2 | 22 ------- .../molecule/default/molecule.yml | 27 --------- .../molecule/default/playbook.yml | 5 -- .../molecule/default/tests/test_default.py | 17 ------ roles/stackdriver_monitoring/tasks/debian.yml | 18 ------ roles/stackdriver_monitoring/tasks/main.yml | 5 -- roles/stackdriver_monitoring/tasks/redhat.yml | 21 ------- .../templates/default/stackdriver-agent | 9 --- roles/stackdriver_monitoring/vars/main.yml | 2 - 33 files changed, 4 insertions(+), 532 deletions(-) create mode 100644 .gitmodules create mode 160000 roles/google-cloud-ops-agents-ansible delete mode 100644 roles/stackdriver_logging/README.md delete mode 100644 roles/stackdriver_logging/defaults/main.yml delete mode 100644 roles/stackdriver_logging/handlers/main.yml delete mode 100644 roles/stackdriver_logging/meta/main.yml delete mode 100644 roles/stackdriver_logging/molecule/default/.ansible-lint delete mode 100644 roles/stackdriver_logging/molecule/default/.yamllint delete mode 100644 roles/stackdriver_logging/molecule/default/Dockerfile.j2 delete mode 100644 roles/stackdriver_logging/molecule/default/molecule.yml delete mode 100644 roles/stackdriver_logging/molecule/default/playbook.yml delete mode 100644 roles/stackdriver_logging/molecule/default/tests/test_default.py delete mode 100644 roles/stackdriver_logging/tasks/debian.yml delete mode 100644 roles/stackdriver_logging/tasks/main.yml delete mode 100644 roles/stackdriver_logging/tasks/redhat.yml delete mode 100644 roles/stackdriver_logging/templates/default/google-fluentd delete mode 100644 roles/stackdriver_logging/templates/source.conf delete mode 100644 roles/stackdriver_logging/vars/main.yml delete mode 100644 roles/stackdriver_monitoring/README.md delete mode 100644 roles/stackdriver_monitoring/defaults/main.yml delete mode 100644 roles/stackdriver_monitoring/handlers/main.yml delete mode 100644 roles/stackdriver_monitoring/meta/main.yml delete mode 100644 roles/stackdriver_monitoring/molecule/default/.ansible-lint delete mode 100644 roles/stackdriver_monitoring/molecule/default/.yamllint delete mode 100644 roles/stackdriver_monitoring/molecule/default/Dockerfile.j2 delete mode 100644 roles/stackdriver_monitoring/molecule/default/molecule.yml delete mode 100644 roles/stackdriver_monitoring/molecule/default/playbook.yml delete mode 100644 roles/stackdriver_monitoring/molecule/default/tests/test_default.py delete mode 100644 roles/stackdriver_monitoring/tasks/debian.yml delete mode 100644 roles/stackdriver_monitoring/tasks/main.yml delete mode 100644 roles/stackdriver_monitoring/tasks/redhat.yml delete mode 100644 roles/stackdriver_monitoring/templates/default/stackdriver-agent delete mode 100644 roles/stackdriver_monitoring/vars/main.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6075984 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "roles/google-cloud-ops-agents-ansible"] + path = roles/google-cloud-ops-agents-ansible + url = git@github.com:GoogleCloudPlatform/google-cloud-ops-agents-ansible.git diff --git a/roles/google-cloud-ops-agents-ansible b/roles/google-cloud-ops-agents-ansible new file mode 160000 index 0000000..e50a8ec --- /dev/null +++ b/roles/google-cloud-ops-agents-ansible @@ -0,0 +1 @@ +Subproject commit e50a8ec642a4f9e2feb5035c64e04d8d541e58b5 diff --git a/roles/stackdriver_logging/README.md b/roles/stackdriver_logging/README.md deleted file mode 100644 index 36a6deb..0000000 --- a/roles/stackdriver_logging/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# stackdriver_logging - -Ansible role to install the Stackdriver Logging Agent. - -## Requirements - -Permissions to Google Cloud API. If running on an old Compute Engine instance or -Compute Engine instances created without the default credentials, then you must -complete the following steps - - -## Role Variables - -| Variable | Default | Comments | -| ------------------------------ | ------------------------------ | -------------------------------------------------- | -| `stackdriver_log_service_name` | Please see `defaults/main.yml` | Stackdriver service name | -| `stackdriver_log_package_name` | Please see `defaults/main.yml` | Package name of the Stackdriver agent | -| `stackdriver_log_repo_host` | Please see `defaults/main.yml` | Hostname of the repository the package is loacated | -| `stackdriver_log_repo_suffix` | Please see `defaults/main.yml` | Sufffix for the repository ex. `all` | -| `stackdriver_http_proxy` | Undefined | HTTP Proxy for Stackdriver | -| `stackdriver_https_proxy` | Undefined | HTTPS Proxy for Stackdriver | -| `stackdriver_no_proxy` | Undefined | Skip proxy for the local Metadata Server. | - -### Debian Specific - -| Variable | Required | Comments | -| ------------------------------- | ------------------------------ | ---------------------------------------------------- | -| `stackdriver_log_apt_repo_url` | Please see `defaults/main.yml` | APT repository url | -| `stackdriver_log_apt_gpg_key` | Please see `defaults/main.yml` | GPG Key for verifying the APT repository. | -| `stackdriver_log_apt_repo_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | - -### RedHat Specific - -| Variable | Required | Comments | -| ------------------------------- | ------------------------------ | ---------------------------------------------------- | -| `stackdriver_log_yum_repo_url` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_log_yum_repo_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_log_yum_repo` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_log_yum_gpg_key` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_log_service_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | - -## Dependencies - -## Example Playbook - -```yaml -- hosts: localhost - become: yes - roles: - - role: google.cloud.stackdriver_logging -``` - -## License - -GPLv3 - -## Author Information - -[Eric Anderson](https://ericsysmin.com) diff --git a/roles/stackdriver_logging/defaults/main.yml b/roles/stackdriver_logging/defaults/main.yml deleted file mode 100644 index a46371d..0000000 --- a/roles/stackdriver_logging/defaults/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# defaults file for stackdriver_logging - -stackdriver_log_service_name: google-fluentd -stackdriver_log_package_name: google-fluentd -stackdriver_log_config_type: unstructured -stackdriver_log_config_name: "{{ 'google-fluentd-catch-all-config' if stackdriver_log_config_type == 'unstructured' \ - else 'google-fluentd-catch-all-config-structured' }}" -stackdriver_log_catch_all_conf: true -stackdriver_log_repo_host: packages.cloud.google.com -stackdriver_log_repo_suffix_value: "{{ '-' ~ stackdriver_log_repo_suffix if stackdriver_log_repo_suffix is defined else '' }}" - -# debian package -stackdriver_log_apt_repo_url: https://{{ stackdriver_log_repo_host }}/apt -stackdriver_log_apt_gpg_key: "{{ stackdriver_log_apt_repo_url }}/doc/apt-key.gpg" -stackdriver_log_apt_repo_name: >- - google-cloud-logging-wheezy{{ stackdriver_log_repo_suffix_value }} - -# yum package -stackdriver_log_yum_repo_url: https://{{ stackdriver_log_repo_host }}/yum -stackdriver_log_yum_repo_name: >- - google-cloud-monitoring-el{{ ansible_distribution_major_version }}-{{ ansible_architecture }}{{ stackdriver_log_repo_suffix_value }} -stackdriver_log_yum_repo: "{{ stackdriver_log_yum_repo_url }}/repos/{{ stackdriver_log_yum_repo_name }}" -stackdriver_log_yum_gpg_key: - - "{{ stackdriver_log_yum_repo_url }}/doc/yum-key.gpg" - - "{{ stackdriver_log_yum_repo_url }}/doc/rpm-package-key.gpg" diff --git a/roles/stackdriver_logging/handlers/main.yml b/roles/stackdriver_logging/handlers/main.yml deleted file mode 100644 index 7a65d55..0000000 --- a/roles/stackdriver_logging/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# handlers file for stackdriver_logging - -- name: Stackdriver Logging | Restart Stackdriver Agent - service: name={{ stackdriver_log_service_name }} state=restarted diff --git a/roles/stackdriver_logging/meta/main.yml b/roles/stackdriver_logging/meta/main.yml deleted file mode 100644 index b1a5aef..0000000 --- a/roles/stackdriver_logging/meta/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -galaxy_info: - author: ericsysmin - role_name: stackdriver_logging - description: Ansible role to install Stackdriver logging agent - license: Apache-2.0 - min_ansible_version: 2.8 - platforms: - - name: EL - versions: - - 6 - - 7 - - 8 - - name: Ubuntu - versions: - - precise - - trusty - - xenial - galaxy_tags: [] -dependencies: [] diff --git a/roles/stackdriver_logging/molecule/default/.ansible-lint b/roles/stackdriver_logging/molecule/default/.ansible-lint deleted file mode 100644 index e74e096..0000000 --- a/roles/stackdriver_logging/molecule/default/.ansible-lint +++ /dev/null @@ -1,6 +0,0 @@ ---- -parseable: true -skip_list: - - ANSIBLE0010 -use_default_rules: true -verbosity: 1 diff --git a/roles/stackdriver_logging/molecule/default/.yamllint b/roles/stackdriver_logging/molecule/default/.yamllint deleted file mode 100644 index ad0be76..0000000 --- a/roles/stackdriver_logging/molecule/default/.yamllint +++ /dev/null @@ -1,11 +0,0 @@ -extends: default - -rules: - braces: - max-spaces-inside: 1 - level: error - brackets: - max-spaces-inside: 1 - level: error - line-length: disable - truthy: disable diff --git a/roles/stackdriver_logging/molecule/default/Dockerfile.j2 b/roles/stackdriver_logging/molecule/default/Dockerfile.j2 deleted file mode 100644 index 0de39e6..0000000 --- a/roles/stackdriver_logging/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,22 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -{% if item.env is defined %} -{% for var, value in item.env.items() %} -{% if value %} -ENV {{ var }} {{ value }} -{% endif %} -{% endfor %} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/roles/stackdriver_logging/molecule/default/molecule.yml b/roles/stackdriver_logging/molecule/default/molecule.yml deleted file mode 100644 index a164da9..0000000 --- a/roles/stackdriver_logging/molecule/default/molecule.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -lint: - name: yamllint - options: - config-file: molecule/default/.yamllint -platforms: - - name: instance - image: ${MOLECULE_DISTRO} - privileged: true - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro -provisioner: - name: ansible - lint: - name: ansible-lint - options: - c: molecule/default/.ansible-lint -scenario: - name: default -verifier: - name: testinfra - lint: - name: flake8 diff --git a/roles/stackdriver_logging/molecule/default/playbook.yml b/roles/stackdriver_logging/molecule/default/playbook.yml deleted file mode 100644 index 81a5f1d..0000000 --- a/roles/stackdriver_logging/molecule/default/playbook.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Converge - hosts: all - roles: - - role: stackdriver_logging diff --git a/roles/stackdriver_logging/molecule/default/tests/test_default.py b/roles/stackdriver_logging/molecule/default/tests/test_default.py deleted file mode 100644 index 01ddd3c..0000000 --- a/roles/stackdriver_logging/molecule/default/tests/test_default.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -import os -import testinfra.utils.ansible_runner - -__metaclass__ = type - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE'] -).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/roles/stackdriver_logging/tasks/debian.yml b/roles/stackdriver_logging/tasks/debian.yml deleted file mode 100644 index f7b79b6..0000000 --- a/roles/stackdriver_logging/tasks/debian.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Stackdriver Logging | Debian | Add the Stackdriver repository - apt_repository: - repo: "deb {{ stackdriver_log_apt_repo_url }} {{ stackdriver_log_apt_repo_name }} main" - filename: google-cloud-logging - state: present - -- name: Stackdriver Logging | Debian | Ensure Stackdriver's GPG key is available. - apt_key: - url: "{{ stackdriver_log_apt_repo_url }}/doc/apt-key.gpg" - state: present - -- name: Stackdriver Logging | Debian | Install the Stackdriver agent - apt: - name: "{{ stackdriver_log_package_name }}" - state: present - update_cache: yes - notify: Stackdriver Logging | Restart Stackdriver Agent - -- name: Stackdriver Logging | Debian | Install the Stackdriver catch all config - apt: - name: "{{ stackdriver_log_config_name }}" - state: present - update_cache: yes - when: stackdriver_log_catch_all_conf diff --git a/roles/stackdriver_logging/tasks/main.yml b/roles/stackdriver_logging/tasks/main.yml deleted file mode 100644 index 892bdda..0000000 --- a/roles/stackdriver_logging/tasks/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# tasks file for stackdriver_logging - -- name: Stackdriver Logging | OS Based Installation - include_tasks: "{{ ansible_os_family|lower }}.yml" - -- name: Stackdriver Logging | Install the Stackdriver defaults file - template: - src: default/google-fluentd - dest: /etc/default/google-fluentd - when: stackdriver_http_proxy is defined or - stackdriver_https_proxy is defined - -- name: Stackdriver Logging | Install the logging files - template: - src: source.conf - dest: /etc/google-fluentd/config.d/{{ item.name }}.conf - loop: "{{ stackdriver_log_files }}" - when: stackdriver_log_files is defined - notify: Stackdriver Logging | Restart Stackdriver Agent diff --git a/roles/stackdriver_logging/tasks/redhat.yml b/roles/stackdriver_logging/tasks/redhat.yml deleted file mode 100644 index ebd4e6c..0000000 --- a/roles/stackdriver_logging/tasks/redhat.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Stackdriver Logging | RedHat | Install the Python bindings for SELinux - yum: name=libselinux-python state=present - -- name: Stackdriver Logging | RedHat | Add the Stackdriver repository - yum_repository: - name: google-cloud-logging - description: Google Cloud Logging Agent Repository - baseurl: "{{ stackdriver_log_yum_repo }}" - file: google-cloud-logging - enabled: yes - gpgcheck: yes - repo_gpgcheck: yes - gpgkey: "{{ stackdriver_log_yum_gpg_key }}" - -- name: Stackdriver Logging | RedHat | Install Stackdriver agent - yum: - name: "{{ stackdriver_log_package_name }}" - state: present - notify: Stackdriver Logging | Restart Stackdriver Agent diff --git a/roles/stackdriver_logging/templates/default/google-fluentd b/roles/stackdriver_logging/templates/default/google-fluentd deleted file mode 100644 index c83cbfc..0000000 --- a/roles/stackdriver_logging/templates/default/google-fluentd +++ /dev/null @@ -1,8 +0,0 @@ -# {{ ansible_managed }} -{% if stackdriver_http_proxy is defined %} -export http_proxy="{{ stackdriver_http_proxy }}" -{% endif %} -{% if stackdriver_https_proxy is defined %} -export https_proxy="{{ stackdriver_https_proxy }}" -{% endif %} -export no_proxy==169.254.169.254 diff --git a/roles/stackdriver_logging/templates/source.conf b/roles/stackdriver_logging/templates/source.conf deleted file mode 100644 index 43e7e47..0000000 --- a/roles/stackdriver_logging/templates/source.conf +++ /dev/null @@ -1,11 +0,0 @@ -# {{ ansible_managed }} -{% for source in item.sources %} - - @type tail - format {{ source.format }} - path {{ source.path }} - pos_file {{ source.pos_file }} - read_from_head {{ source.read_from_head|string|lower }} - tag {{ source.tag }} - -{% endfor %} diff --git a/roles/stackdriver_logging/vars/main.yml b/roles/stackdriver_logging/vars/main.yml deleted file mode 100644 index 7a75804..0000000 --- a/roles/stackdriver_logging/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for stackdriver_logging diff --git a/roles/stackdriver_monitoring/README.md b/roles/stackdriver_monitoring/README.md deleted file mode 100644 index 313f963..0000000 --- a/roles/stackdriver_monitoring/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# stackdriver_monitoring - -Ansible role to install the Stackdriver Logging Agent. - -## Requirements - -Permissions to Google Cloud API. If running on an old Compute Engine instance or -Compute Engine instances created without the default credentials, then you must -complete the following steps - - -## Role Variables - -| Variable | Default | Comments | -| ------------------------------ | ------------------------------ | -------------------------------------------------- | -| `stackdriver_mon_service_name` | Please see `defaults/main.yml` | Stackdriver service name | -| `stackdriver_mon_package_name` | Please see `defaults/main.yml` | Package name of the Stackdriver agent | -| `stackdriver_mon_repo_host` | Please see `defaults/main.yml` | Hostname of the repository the package is loacated | -| `stackdriver_mon_repo_suffix` | Please see `defaults/main.yml` | Sufffix for the repository ex. `all` | -| `stackdriver_http_proxy` | Undefined | HTTP Proxy for Stackdriver | -| `stackdriver_https_proxy` | Undefined | HTTPS Proxy for Stackdriver | -| `stackdriver_no_proxy` | Undefined | Skip proxy for the local Metadata Server. | - -### Debian Specific - -| Variable | Required | Comments | -| ------------------------------- | ------------------------------ | ---------------------------------------------------- | -| `stackdriver_mon_apt_repo_url` | Please see `defaults/main.yml` | APT repository url | -| `stackdriver_mon_apt_gpg_key` | Please see `defaults/main.yml` | GPG Key for verifying the APT repository. | -| `stackdriver_mon_apt_repo_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | - -### RedHat Specific - -| Variable | Required | Comments | -| ------------------------------- | ------------------------------ | ---------------------------------------------------- | -| `stackdriver_mon_yum_repo_url` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_mon_yum_repo_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_mon_yum_repo` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_mon_yum_gpg_key` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | -| `stackdriver_mon_service_name` | Please see `defaults/main.yml` | Skips any requirements for disk space, ram, and cpu. | - -## Dependencies - -## Example Playbook - -```yaml -- hosts: localhost - become: yes - tasks: - - include_role: - name: google.cloud.stackdriver_monitoring -``` - -## License - -GPLv3 - -## Author Information - -[Eric Anderson](https://ericsysmin.com) diff --git a/roles/stackdriver_monitoring/defaults/main.yml b/roles/stackdriver_monitoring/defaults/main.yml deleted file mode 100644 index 095e839..0000000 --- a/roles/stackdriver_monitoring/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# defaults file for stackdriver_monitoring - -stackdriver_mon_service_name: stackdriver-agent -stackdriver_mon_package_name: stackdriver-agent -stackdriver_mon_repo_host: packages.cloud.google.com -stackdriver_mon_repo_suffix: all - -# debian package -stackdriver_mon_apt_repo_url: https://{{ stackdriver_mon_repo_host }}/apt -stackdriver_mon_apt_gpg_key: "{{ stackdriver_mon_apt_repo_url }}/doc/apt-key.gpg" -stackdriver_mon_apt_repo_name: google-cloud-monitoring-{{ ansible_lsb.codename }}-{{ stackdriver_mon_repo_suffix }} - -# yum package -stackdriver_mon_yum_repo_url: https://{{ stackdriver_mon_repo_host }}/yum -stackdriver_mon_yum_repo_name: google-cloud-monitoring-el{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-{{ stackdriver_mon_repo_suffix }} -stackdriver_mon_yum_repo: "{{ stackdriver_mon_yum_repo_url }}/repos/{{ stackdriver_mon_yum_repo_name }}" -stackdriver_mon_yum_gpg_key: - - "{{ stackdriver_mon_yum_repo_url }}/doc/yum-key.gpg" - - "{{ stackdriver_mon_yum_repo_url }}/doc/rpm-package-key.gpg" diff --git a/roles/stackdriver_monitoring/handlers/main.yml b/roles/stackdriver_monitoring/handlers/main.yml deleted file mode 100644 index 1d5add9..0000000 --- a/roles/stackdriver_monitoring/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# handlers file for stackdriver_monitoring - -- name: Stackdriver Monitoring | Restart Stackdriver Agent - service: name={{ stackdriver_mon_service_name }} state=restarted diff --git a/roles/stackdriver_monitoring/meta/main.yml b/roles/stackdriver_monitoring/meta/main.yml deleted file mode 100644 index 3c0a883..0000000 --- a/roles/stackdriver_monitoring/meta/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -galaxy_info: - author: ericsysmin - role_name: stackdriver_monitoring - description: Ansible role to install Stackdriver monitoring agent - license: Apache-2.0 - min_ansible_version: 2.8 - platforms: - - name: EL - versions: - - 6 - - 7 - - 8 - - name: Ubuntu - versions: - - precise - - trusty - - xenial - galaxy_tags: [] -dependencies: [] diff --git a/roles/stackdriver_monitoring/molecule/default/.ansible-lint b/roles/stackdriver_monitoring/molecule/default/.ansible-lint deleted file mode 100644 index e74e096..0000000 --- a/roles/stackdriver_monitoring/molecule/default/.ansible-lint +++ /dev/null @@ -1,6 +0,0 @@ ---- -parseable: true -skip_list: - - ANSIBLE0010 -use_default_rules: true -verbosity: 1 diff --git a/roles/stackdriver_monitoring/molecule/default/.yamllint b/roles/stackdriver_monitoring/molecule/default/.yamllint deleted file mode 100644 index ad0be76..0000000 --- a/roles/stackdriver_monitoring/molecule/default/.yamllint +++ /dev/null @@ -1,11 +0,0 @@ -extends: default - -rules: - braces: - max-spaces-inside: 1 - level: error - brackets: - max-spaces-inside: 1 - level: error - line-length: disable - truthy: disable diff --git a/roles/stackdriver_monitoring/molecule/default/Dockerfile.j2 b/roles/stackdriver_monitoring/molecule/default/Dockerfile.j2 deleted file mode 100644 index 0de39e6..0000000 --- a/roles/stackdriver_monitoring/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,22 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -{% if item.env is defined %} -{% for var, value in item.env.items() %} -{% if value %} -ENV {{ var }} {{ value }} -{% endif %} -{% endfor %} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/roles/stackdriver_monitoring/molecule/default/molecule.yml b/roles/stackdriver_monitoring/molecule/default/molecule.yml deleted file mode 100644 index a164da9..0000000 --- a/roles/stackdriver_monitoring/molecule/default/molecule.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -lint: - name: yamllint - options: - config-file: molecule/default/.yamllint -platforms: - - name: instance - image: ${MOLECULE_DISTRO} - privileged: true - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro -provisioner: - name: ansible - lint: - name: ansible-lint - options: - c: molecule/default/.ansible-lint -scenario: - name: default -verifier: - name: testinfra - lint: - name: flake8 diff --git a/roles/stackdriver_monitoring/molecule/default/playbook.yml b/roles/stackdriver_monitoring/molecule/default/playbook.yml deleted file mode 100644 index 78d7ab2..0000000 --- a/roles/stackdriver_monitoring/molecule/default/playbook.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Converge - hosts: all - roles: - - role: stackdriver_monitoring diff --git a/roles/stackdriver_monitoring/molecule/default/tests/test_default.py b/roles/stackdriver_monitoring/molecule/default/tests/test_default.py deleted file mode 100644 index 01ddd3c..0000000 --- a/roles/stackdriver_monitoring/molecule/default/tests/test_default.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -import os -import testinfra.utils.ansible_runner - -__metaclass__ = type - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE'] -).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/roles/stackdriver_monitoring/tasks/debian.yml b/roles/stackdriver_monitoring/tasks/debian.yml deleted file mode 100644 index cd49a9e..0000000 --- a/roles/stackdriver_monitoring/tasks/debian.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Stackdriver Monitoring | Debian | Add the Stackdriver repository - apt_repository: - repo: "deb {{ stackdriver_mon_apt_repo_url }} {{ stackdriver_mon_apt_repo_name }} main" - filename: google-cloud-monitoring - state: present - -- name: Stackdriver Monitoring | Debian | Ensure Stackdriver's GPG key is available. - apt_key: - url: "{{ stackdriver_mon_apt_repo_url }}/doc/apt-key.gpg" - state: present - -- name: Stackdriver Monitoring | Debian | Install the Stackdriver agent - apt: - name: "{{ stackdriver_mon_package_name }}" - state: present - update_cache: yes - notify: Stackdriver Monitoring | Restart Stackdriver Agent diff --git a/roles/stackdriver_monitoring/tasks/main.yml b/roles/stackdriver_monitoring/tasks/main.yml deleted file mode 100644 index ba8ae8f..0000000 --- a/roles/stackdriver_monitoring/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# tasks file for stackdriver_monitoring - -- name: Stackdriver Monitoring | OS Based Installation - include_tasks: "{{ ansible_os_family|lower }}.yml" diff --git a/roles/stackdriver_monitoring/tasks/redhat.yml b/roles/stackdriver_monitoring/tasks/redhat.yml deleted file mode 100644 index 6e035aa..0000000 --- a/roles/stackdriver_monitoring/tasks/redhat.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Stackdriver Monitoring | RedHat | Install the Python bindings for SELinux - yum: name=libselinux-python state=present - -- name: Stackdriver Monitoring | RedHat | Add the Stackdriver repository - yum_repository: - name: google-cloud-monitoring - description: Google Cloud Monitoring Agent Repository - baseurl: "{{ stackdriver_mon_yum_repo }}" - file: google-cloud-monitoring - enabled: yes - gpgcheck: yes - repo_gpgcheck: yes - gpgkey: "{{ stackdriver_mon_yum_gpg_key }}" - - -- name: Stackdriver Monitoring | RedHat | Install Stackdriver agent - yum: - name: "{{ stackdriver_mon_package_name }}" - state: present - notify: Stackdriver Monitoring | Restart Stackdriver Agent diff --git a/roles/stackdriver_monitoring/templates/default/stackdriver-agent b/roles/stackdriver_monitoring/templates/default/stackdriver-agent deleted file mode 100644 index 0b33463..0000000 --- a/roles/stackdriver_monitoring/templates/default/stackdriver-agent +++ /dev/null @@ -1,9 +0,0 @@ -{% if stackdriver_http_proxy is defined %} -export http_proxy="{{ stackdriver_http_proxy }}" -{% endif %} -{% if stackdriver_https_proxy is defined %} -export https_proxy="{{ stackdriver_https_proxy }}" -{% endif %} -{% if stackdriver_no_proxy %} -export no_proxy==169.254.169.254 -{% endif %} diff --git a/roles/stackdriver_monitoring/vars/main.yml b/roles/stackdriver_monitoring/vars/main.yml deleted file mode 100644 index 29e01cc..0000000 --- a/roles/stackdriver_monitoring/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for stackdriver_monitoring