mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-06 10:50:28 -07:00
Remove exisiting role, and add new one using submodules
This commit is contained in:
parent
1ec23f5fa4
commit
03bf1679b2
33 changed files with 4 additions and 532 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -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
|
1
roles/google-cloud-ops-agents-ansible
Submodule
1
roles/google-cloud-ops-agents-ansible
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e50a8ec642a4f9e2feb5035c64e04d8d541e58b5
|
|
@ -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
|
|
||||||
<https://cloud.google.com/logging/docs/agent/authorization#before_you_begin>
|
|
||||||
|
|
||||||
## 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)
|
|
|
@ -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"
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
# handlers file for stackdriver_logging
|
|
||||||
|
|
||||||
- name: Stackdriver Logging | Restart Stackdriver Agent
|
|
||||||
service: name={{ stackdriver_log_service_name }} state=restarted
|
|
|
@ -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: []
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
parseable: true
|
|
||||||
skip_list:
|
|
||||||
- ANSIBLE0010
|
|
||||||
use_default_rules: true
|
|
||||||
verbosity: 1
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
roles:
|
|
||||||
- role: stackdriver_logging
|
|
|
@ -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'
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -1,11 +0,0 @@
|
||||||
# {{ ansible_managed }}
|
|
||||||
{% for source in item.sources %}
|
|
||||||
<source>
|
|
||||||
@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 }}
|
|
||||||
</source>
|
|
||||||
{% endfor %}
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
# vars file for stackdriver_logging
|
|
|
@ -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
|
|
||||||
<https://cloud.google.com/monitoring/agent/authorization#before_you_begin>
|
|
||||||
|
|
||||||
## 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)
|
|
|
@ -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"
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
# handlers file for stackdriver_monitoring
|
|
||||||
|
|
||||||
- name: Stackdriver Monitoring | Restart Stackdriver Agent
|
|
||||||
service: name={{ stackdriver_mon_service_name }} state=restarted
|
|
|
@ -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: []
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
parseable: true
|
|
||||||
skip_list:
|
|
||||||
- ANSIBLE0010
|
|
||||||
use_default_rules: true
|
|
||||||
verbosity: 1
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
roles:
|
|
||||||
- role: stackdriver_monitoring
|
|
|
@ -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'
|
|
|
@ -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
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
# tasks file for stackdriver_monitoring
|
|
||||||
|
|
||||||
- name: Stackdriver Monitoring | OS Based Installation
|
|
||||||
include_tasks: "{{ ansible_os_family|lower }}.yml"
|
|
|
@ -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
|
|
|
@ -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 %}
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
# vars file for stackdriver_monitoring
|
|
Loading…
Add table
Reference in a new issue