create molecule scenario for monitoring role

This commit is contained in:
HgO
2020-12-02 17:22:59 +01:00
parent 0f32a76e38
commit 2ace573ac9
21 changed files with 226 additions and 79 deletions

View File

@@ -0,0 +1,23 @@
*********************************
Vagrant driver installation guide
*********************************
Requirements
============
* Vagrant
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule_vagrant'

View File

@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all
become: yes
pre_tasks:
- name: Install and configure node-exporter
import_role:
name: common
tasks_from: node_exporter.yml
roles:
- monitoring

View File

@@ -0,0 +1,50 @@
---
.hardware: &hardware
memory: 1024
cpu: 2
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: virtualbox
platforms:
- name: debian-buster.mol
box: debian/buster64
<<: *hardware
interfaces:
- network_name: private_network
type: dhcp
auto_config: true
- network_name: forwarded_port
guest: 80
host: 18080
- network_name: forwarded_port
guest: 443
host: 18443
options:
append_platform_to_hostname: no
- name: ubuntu-focal.mol
box: ubuntu/focal64
<<: *hardware
interfaces:
- network_name: private_network
type: dhcp
auto_config: true
- network_name: forwarded_port
guest: 80
host: 28080
- network_name: forwarded_port
guest: 443
host: 28443
options:
append_platform_to_hostname: no
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: /usr/bin/python3
vault_password_file: "${MOLECULE_PROJECT_DIRECTORY}/../../.vault.secret"
verifier:
name: ansible

View File

@@ -0,0 +1,19 @@
- hosts: all
become: yes
pre_tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
tasks:
- name: Install and configure UFW
import_role:
name: common
tasks_from: ufw.yml
- name: Install and configure Nginx
import_role:
name: common
tasks_from: nginx.yml