create molecule scenario for monitoring role
This commit is contained in:
23
roles/monitoring/molecule/default/INSTALL.rst
Normal file
23
roles/monitoring/molecule/default/INSTALL.rst
Normal 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'
|
||||
13
roles/monitoring/molecule/default/converge.yml
Normal file
13
roles/monitoring/molecule/default/converge.yml
Normal 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
|
||||
50
roles/monitoring/molecule/default/molecule.yml
Normal file
50
roles/monitoring/molecule/default/molecule.yml
Normal 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
|
||||
19
roles/monitoring/molecule/default/prepare.yml
Normal file
19
roles/monitoring/molecule/default/prepare.yml
Normal 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
|
||||
Reference in New Issue
Block a user