Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
warn_list:
- 'role-name'
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---

name: "CI"

on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:
branches:
- "main"

env:
python_version: "3.9"

jobs:
test:
name: "Molecule"
runs-on: "ubuntu-latest"
strategy:
matrix:
distro:
- "debian10"

steps:
- name: "Check out the codebase"
# see https://github.com/marketplace/actions/checkout
uses: "actions/checkout@v2"

- name: "Set up Python"
# see https://github.com/marketplace/actions/setup-python
uses: "actions/setup-python@v2"
with:
python-version: "${{ env.python_version }}"

- name: "Cache Python packages"
# see https://github.com/marketplace/actions/cache
uses: "actions/cache@v2"
env:
cache_name: "pip"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-${{ env.cache_name }}-${{ hashFiles('**/requirements.txt') }}"
restore-keys: |
${{ runner.os }}-${{ env.cache_name }}-

- name: "Install Python dependencies"
run: |
python -m pip install wheel
python -m pip install --no-deps --requirement requirements.txt

- name: "Install galaxy roles"
run: "ansible-galaxy install --role-file requirements.yml"

- name: "(Workaround) Remove all identities except of dev from vault_identity_list"
# See https://github.com/marketplace/actions/find-and-replace
uses: "jacobtomlinson/gha-find-replace@master"
with:
find: "vault_identity_list.*"
replace: "vault_identity_list = dev@.vault-pass.dev"
include: "ansible.cfg"

- name: "Run Molecule tests"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: "${{ matrix.distro }}"
run: "molecule test"
1 change: 1 addition & 0 deletions .vault-pass.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
56/@,v61yHDn.Df4u93yk§´lR@SK4F(N#Mi@A(vhkx))lm$fpsv1k8/°yCLT
35 changes: 35 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# Based on ansible-lint config
extends: default
ignore: |
src/molecule/cookiecutter/scenario/driver/delegated/{{cookiecutter.molecule_directory}}
src/molecule/cookiecutter/molecule/{{cookiecutter.role_name}}
src/molecule/cookiecutter/scenario/verifier/ansible/{{cookiecutter.molecule_directory}}
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
87 changes: 87 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# -*- 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.define "node0"

config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.tags = "all" # change to "all, recreate" to recreate git repos
ansible.groups = {
"dev" => ["node0"],
}
end


# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "generic/debian10"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.network "forwarded_port", guest: 9090, host: 9090
config.vm.network "forwarded_port", guest: 9091, host: 9091
config.vm.network "forwarded_port", guest: 9093, host: 9093
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.network "forwarded_port", guest: 8443, host: 8443

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
8 changes: 8 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[defaults]
vault_identity_list = prod@~/.ansible/vaults/bvrn/.vault-pass.prod, dev@.vault-pass.dev
INVENTORY = inventory
deprecation_warnings=False
interpreter_python = /usr/bin/python3
stdout_callback = debug
strategy = free
forks = 30
Loading