Initial ansible onboard
This commit is contained in:
@@ -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'
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Update Package Cache (apt/Ubuntu)
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
|
||||
- name: Update Package Cache (dnf/CentOS)
|
||||
become: true
|
||||
ansible.builtin.dnf:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "CentOS"
|
||||
|
||||
- name: Update Package Cache (yum/Amazon)
|
||||
become: true
|
||||
ansible.builtin.yum:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "Amazon"
|
||||
|
||||
- name: "Include geoip"
|
||||
ansible.builtin.include_role:
|
||||
name: "geoip"
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
enabled: true
|
||||
driver:
|
||||
name: podman
|
||||
platforms:
|
||||
- name: instance
|
||||
image: ubuntu:20.04
|
||||
pre_build_image: true
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
callbacks_enabled: profile_tasks
|
||||
log: true
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
ssh_allowed_zones:
|
||||
- "ALL"
|
||||
ssh_allowed_networks:
|
||||
- "0.0.0.0/0"
|
||||
geoip_ufw_enabled: true
|
||||
geoip_sshd_enabled: true
|
||||
geoip_haproxy_enabled: true
|
||||
host_vars: {}
|
||||
playbooks:
|
||||
converge: converge.yml
|
||||
prepare: prepare.yml
|
||||
verifier:
|
||||
name: ansible
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Prepare
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Update cache # noqa no-changed-when
|
||||
ansible.builtin.raw: apt update
|
||||
|
||||
- name: Install required packages # noqa no-changed-when
|
||||
ansible.builtin.raw: apt install -y python3 sudo cron
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Example assertion
|
||||
ansible.builtin.assert:
|
||||
that: true
|
||||
Reference in New Issue
Block a user