https://github.com/gdatasoftwareag/ansiblemoleculeworkshop-lessons
https://github.com/gdatasoftwareag/ansiblemoleculeworkshop-lessons
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gdatasoftwareag/ansiblemoleculeworkshop-lessons
- Owner: GDATASoftwareAG
- Created: 2020-03-23T15:51:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-30T22:06:02.000Z (about 1 year ago)
- Last Synced: 2025-04-05T10:33:26.532Z (about 1 year ago)
- Language: Python
- Size: 50.8 KB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Molecule workshop lessons
Here you find the lessons where we start the parts of our workshops from.
Most of the lessons are also the target of their previous lessons.
Please start with a new folder for every lesson. Don't begin to work in the lessons folders.
* [Lesson 1](./LESSON1.md)
* [Lesson 2](./LESSON2.md)
* [Lesson 3](./LESSON3.md)
* [Lesson 4](./LESSON4.md)
* [Lesson 5](./LESSON5.md)
## Versions
This workshop was created with
* Python: 3.8.1
* Ansible: 2.9.4
* Molecule: 3.0.2
## Links
* [molecule documentation](https://molecule.readthedocs.io/en/latest/)
* [molecule github](https://github.com/ansible-community/molecule)
* [molecule docker](https://quay.io/repository/ansible/molecule)
* [testinfra documentation](https://testinfra.readthedocs.io/en/latest/)
## Running Molecule within a role with the latest image
IMPORTANT: If you want to run these tests locally your docker engine must use the storage-engine aufs
Just create or edit the config file /etc/docker/daemon.json with content
```json3.8.1
"storage-driver": "aufs"
}
```
then run in a role directory
```bash
docker run \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd):$(pwd) -w $(pwd) \
--user root \
quay.io/ansible/molecule:3.0.2 \
/bin/sh -c "pip3 install testinfra; molecule test -s default"
```
## you want to give us your power for the workshop
```bash
docker run -d --rm --name gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/gitlab-runner:/home/gitlab-runner \
-v /buiilds:/builds \
--privileged \
gitlab/gitlab-runner:latest
```
```bash
docker exec -it gitlab-runner /bin/bash
```
```bash
gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token GZqpz8aRxUqiY3FsNqAz \
--executor docker --description "MYRUNNERNAME" \
--docker-image "docker:19.03.1" \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock \
--docker-volumes /home/gitlab-runner:/home/gitlab-runner \
--docker-volumes /builds:/builds --tag-list molecule-workshop
```
This registeres a gitlab-runner on your local machine that can be used in the workshop. This is for careful use and should be killed after the workshop.