Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stuttgart-things/install-configure-docker
install configure docker (compose) and or kind
https://github.com/stuttgart-things/install-configure-docker
ansible containerization containers docker kind linux
Last synced: 2 days ago
JSON representation
install configure docker (compose) and or kind
- Host: GitHub
- URL: https://github.com/stuttgart-things/install-configure-docker
- Owner: stuttgart-things
- License: apache-2.0
- Created: 2023-06-07T11:38:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T19:56:32.000Z (6 months ago)
- Last Synced: 2024-04-30T13:37:31.586Z (6 months ago)
- Topics: ansible, containerization, containers, docker, kind, linux
- Language: Jinja
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
stuttgart-things/install-configure-docker
=========================================deployment and configuration of docker (compose).
VARIABLES
* `set_proxy` - Set on true to generate http-proxy.conf (default:false)
* `add_registry_mirrors` - Set on true to Configure daemon.json (default:false)
* `login_into_private_registry` - Set on true to install python packages and to log into a private registry (default:false)
* `install_kind` - Set on true to install Kind and Kubectl (default:false)
* `docker_install_compose` - Set on true/false to (not) install docker composeROLE INSTALLATION
installs role and all of it's dependencies w/:
```bash
cat < /tmp/requirements.yaml
---
roles:
- src: https://github.com/stuttgart-things/install-configure-docker.git
version: 2024-04-29
scm: git
- src: https://github.com/stuttgart-things/install-requirements.git
scm: gitcollections:
- name: community.general
version: 8.6.0
- name: community.docker
version: 3.9.0
EOFansible-galaxy install -r /tmp/requirements.yaml --force
ansible-galaxy collection install -r /tmp/requirements.yaml --force
rm -rf /tmp/requirements.yaml
```EXAMPLE INVENTORY
```bash
cat < inventory
[appserver]
1.2.3.4 ansible_user=sthings
EOF
```EXAMPLE PLAYBOOK - BASIC DOCKER AND DOCKER COMPOSE INSTALLATION
```yaml
cat < install-configure-docker.yaml
---
- hosts: "{{ target_host | default('all') }}"
become: truevars:
docker_install_compose: true
docker_version: '' # leave empty for latest version or set e.g. '=5:23.0.6-1~ubuntu.23.04~lunar'roles:
- install-configure-docker
EOF
```EXAMPLE PLAYBOOK - DOCKER INSTALLATION + REGISTRY LOGIN AND MIRROR
```yaml
cat < install-configure-docker.yaml
---
- hosts: "{{ target_host | default('all') }}"
become: truevars:
docker_install_compose: true
docker_version: '' # leave empty for latest version or set e.g. '=5:23.0.6-1~ubuntu.23.04~lunar'add_registry_mirrors: true
registry_mirrors:
- https://harbor.tiab.labda.sva.de
- https://harbor.labul.sva.devault_url: "{{ lookup('env','VAULT_URL') }}"
vault_token: "{{ lookup('env','VAULT_TOKEN') }}"login_into_private_registry: true
private_registry_url: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=harbor/data/harbor validate_certs=false token={{vault_token}} url={{vault_url}}')['url'] }}"
private_registry_user: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=harbor/data/harbor validate_certs=false token={{vault_token}} url={{vault_url}}')['user'] }}"
private_registry_password: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=harbor/data/harbor validate_certs=false token={{vault_token}} url={{vault_url}}')['password'] }}"roles:
- install-configure-docker
EOF
```EXAMPLE PLAYBOOK - DOCKER INSTALLATION + KIND AND KUBECTL
```yaml
cat < install-configure-docker.yaml
---
- hosts: "{{ target_host | default('all') }}"
become: truevars:
docker_install_compose: true
docker_version: '' # leave empty for latest version or set e.g. '=5:23.0.6-1~ubuntu.23.04~lunar'install_kind: true
kind_version: 0.22.0
kubectl_version: 1.30.0EOF
```EXAMPLE EXECUTION
```bash
ansible-playbook -i inventory install-configure-docker.yaml -vv
```## DEV-TASKS
```bash
task: Available tasks for this project:
* branch: Create branch from main
* commit: Commit + push code into branch
* setup-venv: Setup python virtual environment
```### TESTING
```bash
task setup-venv
source ./.venv/bin/activate
task setup-molecule
task run-molecule# deactivate
#rm -rf ./.venv/
```## License
LICENSECopyright 2020 patrick hermann.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.Role history
----------------
| date | who | changelog |
|---|---|---|
|2023-29-04 | Andre Ebert | Added Ansible- and Yamllint with skip rules and collection release workflow
|2021-24-02 | Patrick Hermann | Added support for registry mirrors and login to private registry
|2020-10-10 | Patrick Hermann | Updated for using of ansible collections, fixed role structure, added to be stable version
|2020-04-01 | Patrick Hermann | intial commit for this role in codehubAuthor Information
------------------```yaml
Andre Ebert ([email protected]); 04/2023Patrick Hermann ([email protected]); 04/2020
```(This role was created in 2017 by Jeff Geerling, author of Ansible for DevOps - adopted to be used in multiple stuttgart-things projects by Patrick Hermann in 2020.)