-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
******* | ||
Vagrant driver installation guide | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Vagrant | ||
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop | ||
* python-vagrant | ||
|
||
Install | ||
======= | ||
|
||
.. code-block:: bash | ||
$ sudo pip install python-vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
provider: | ||
name: virtualbox | ||
lint: | ||
name: yamllint | ||
platforms: | ||
- name: xenial | ||
box: ubuntu/xenial64 | ||
provider_raw_config_args: | ||
- "customize ['modifyvm', :id, '--uartmode1', 'disconnected']" | ||
- name: bionic | ||
box: ubuntu/bionic64 | ||
provider_raw_config_args: | ||
- "customize ['modifyvm', :id, '--uartmode1', 'disconnected']" | ||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
scenario: | ||
name: ufw | ||
verifier: | ||
name: goss | ||
lint: | ||
name: yamllint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Converge | ||
become: true | ||
hosts: all | ||
roles: | ||
- role: 3proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Install python for Ansible | ||
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) | ||
become: true | ||
changed_when: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
package: | ||
ufw: | ||
installed: true | ||
port: | ||
tcp:1080: | ||
listening: true | ||
tcp:3128: | ||
listening: true | ||
service: | ||
ufw: | ||
enabled: true | ||
running: true | ||
command: | ||
'grep ''### tuple ###'' /etc/ufw/*.rules': | ||
exit-status: 0 | ||
stdout: | ||
- allow tcp 1080 | ||
- allow tcp 3128 | ||
stderr: [] | ||
timeout: 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# This is an example playbook to execute goss tests. | ||
# Tests need distributed to the appropriate ansible host/groups | ||
# prior to execution by `goss validate`. | ||
|
||
- name: Verify | ||
hosts: all | ||
become: true | ||
vars: | ||
goss_version: v0.3.6 | ||
goss_arch: amd64 | ||
goss_dst: /usr/local/bin/goss | ||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" | ||
goss_test_directory: /tmp | ||
goss_format: json_oneline | ||
tasks: | ||
- name: Download and install Goss | ||
get_url: | ||
url: "{{ goss_url }}" | ||
dest: "{{ goss_dst }}" | ||
mode: 0755 | ||
register: download_goss | ||
until: download_goss is succeeded | ||
retries: 3 | ||
|
||
- name: Copy Goss tests to remote | ||
copy: | ||
src: "{{ item }}" | ||
dest: "{{ goss_test_directory }}/{{ item | basename }}" | ||
with_fileglob: | ||
- "{{ lookup('env', 'MOLECULE_VERIFIER_TEST_DIRECTORY') }}/test_*.yml" | ||
|
||
- name: Register test files | ||
shell: "ls {{ goss_test_directory }}/test_*.yml" | ||
register: test_files | ||
|
||
- name: Execute Goss tests | ||
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}" | ||
register: test_results | ||
with_items: "{{ test_files.stdout_lines }}" | ||
|
||
- name: Display details about the Goss results | ||
debug: | ||
msg: "{{ item.stdout_lines }}" | ||
with_items: "{{ test_results.results }}" | ||
|
||
- name: Fail when tests fail | ||
fail: | ||
msg: "Goss failed to validate" | ||
when: item.rc != 0 | ||
with_items: "{{ test_results.results }}" |