Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit 82b9896

Browse files
author
staticdev
committed
Initial commit
1 parent 0ef09cd commit 82b9896

File tree

8 files changed

+116
-2
lines changed

8 files changed

+116
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
*/__pycache__
33
*.pyc
44
/.python-version
5+
6+
# Visual Studio Code
7+
.vscode/

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Here is the list of all variables and their default values:
3232
## Dependencies
3333

3434
- [staticdev.ansible_galaxy_pyenv](https://github.com/staticdev/ansible-galaxy-pyenv)
35-
- [oefenweb.pycharm](https://galaxy.ansible.com/oefenweb/pycharm) (optional)
36-
- [ngetchell.vscode](https://galaxy.ansible.com/ngetchell/vscode) (optional)
35+
- [gantsign.visual-studio-code](https://galaxy.ansible.com/gantsign/visual-studio-code) (optional)
3736

3837
## Example Playbook
3938

molecule/default/INSTALL.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*******
2+
Delegated driver installation guide
3+
*******
4+
5+
Requirements
6+
============
7+
8+
This driver is delegated to the developer. Up to the developer to implement
9+
requirements.
10+
11+
Install
12+
=======
13+
14+
This driver is delegated to the developer. Up to the developer to implement
15+
requirements.

molecule/default/converge.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
become: true
5+
6+
pre_tasks:
7+
- name: Update apt cache.
8+
apt: update_cache=yes cache_valid_time=600
9+
when: ansible_os_family == 'Debian'
10+
11+
roles:
12+
- ansible-role-python-developer

molecule/default/create.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
- name: Create
3+
hosts: localhost
4+
connection: local
5+
gather_facts: false
6+
no_log: "{{ molecule_no_log }}"
7+
tasks:
8+
9+
# TODO: Developer must implement and populate 'server' variable
10+
11+
- when: server.changed | default(false) | bool
12+
block:
13+
- name: Populate instance config dict
14+
set_fact:
15+
instance_conf_dict: {
16+
'instance': "{{ }}",
17+
'address': "{{ }}",
18+
'user': "{{ }}",
19+
'port': "{{ }}",
20+
'identity_file': "{{ }}", }
21+
with_items: "{{ server.results }}"
22+
register: instance_config_dict
23+
24+
- name: Convert instance config dict to a list
25+
set_fact:
26+
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
27+
28+
- name: Dump instance config
29+
copy:
30+
content: |
31+
# Molecule managed
32+
33+
{{ instance_conf | to_json | from_json | to_yaml }}
34+
dest: "{{ molecule_instance_config }}"

molecule/default/destroy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
- name: Destroy
3+
hosts: localhost
4+
connection: local
5+
gather_facts: false
6+
no_log: "{{ molecule_no_log }}"
7+
tasks:
8+
# Developer must implement.
9+
10+
# Mandatory configuration for Molecule to function.
11+
12+
- name: Populate instance config
13+
set_fact:
14+
instance_conf: {}
15+
16+
- name: Dump instance config
17+
copy:
18+
content: |
19+
# Molecule managed
20+
21+
{{ instance_conf | to_json | from_json | to_yaml }}
22+
dest: "{{ molecule_instance_config }}"
23+
when: server.changed | default(false) | bool

molecule/default/molecule.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
options:
5+
role-file: requirements.yml
6+
driver:
7+
name: docker
8+
platforms:
9+
- name: instance
10+
command: ${MOLECULE_DOCKER_COMMAND:-""}
11+
volumes:
12+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
13+
privileged: true
14+
pre_build_image: true
15+
provisioner:
16+
name: ansible
17+
verifier:
18+
name: ansible

molecule/default/verify.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# This is an example playbook to execute Ansible tests.
3+
4+
- name: Verify
5+
hosts: all
6+
gather_facts: false
7+
tasks:
8+
- name: Example assertion
9+
assert:
10+
that: true

0 commit comments

Comments
 (0)