Skip to content
Snippets Groups Projects
Verified Commit daa3ec06 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add ansible base files

parent 8936970b
No related branches found
No related tags found
No related merge requests found
.idea
.venv
# autogenerated
.template
TODO
\ No newline at end of file
# Ansible
`ansible.cfg`: Base config for ansible.
`requirements.galaxy.yaml`: This files content will
be installed with ansible-galaxy.
`inventory.yaml`: Ansible inventory, by default this
file is already set in the base config so you don't
have to specify it when running
`bootstrap.sh`: This file can be run everytime to
setup your environment. Look into the file, quite simple.
[defaults]
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
inventory = inventory.yaml
[ssh_connection]
ssh_args = -o StrictHostKeyChecking=accept-new
#!/usr/bin/env bash
# This script creates a Python env, enters it and installs
# ansible and requirements from the requirements.galaxy.yaml
[[ ! -d .venv ]] && python3 -m venv .venv
source .venv/bin/activate
pip3 install ansible ansible-lint
ansible-galaxy install --force -r requirements.galaxy.yaml
# to stay in our comfy virtualenv
exec "${SHELL:bash}"
all:
hosts:
# Use OpenSSH config to make it comfortable
host1.sch.bme.hu:
host2.sch.bme.hu:
children:
web:
hosts:
host1.sch.bme.hu: {}
host2.sch.bme.hu: {}
You place here your usual playbook.
Example: https://git.sch.bme.hu/kszk/sysadmin/kubernetes/cluster-setup/-/tree/master/ansible/mgmt
---
collections:
- community.general
- community.crypto
- ansible.posix
# You can include roles from Git
roles:
- src: git@git.sch.bme.hu:kszk/sysadmin/kubernetes/base-ansible-role.git
scm: git
version: master
name: kszk-k8s.base
- src: git@git.sch.bme.hu:kszk/sysadmin/kubernetes/router-ansible-role.git
scm: git
version: "1.1.1"
name: kszk-k8s.router
- src: git@git.sch.bme.hu:kszk/sysadmin/kubernetes/iptables-role.git
scm: git
version: master
name: kszk-k8s.iptables
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment