Skip to content

Commit e8acdd3

Browse files
authored
Initial commit
0 parents  commit e8acdd3

File tree

44 files changed

+411
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+411
-0
lines changed

.ansible-lint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
skip_list:
3+
- yaml[comments-indentation]
4+
5+
extra_vars:
6+
hostvars:
7+
localhost:
8+
example_host_var: dummy_host

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[*.{yml,yaml}]
2+
indent_style = space
3+
indent_size = 2
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
trim_final_newlines = true
7+
insert_final_newline = true
8+
max_line_length = 160

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
on: # yamllint disable-line rule:truthy
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
name: ⚒️ CI
9+
10+
jobs:
11+
yamllint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: yamllint
16+
uses: ibiqlik/action-yamllint@v3
17+
with:
18+
file_or_dir: .
19+
config_file: .yamllint
20+
21+
ansible-lint:
22+
runs-on: ubuntu-latest
23+
container: pipelinecomponents/ansible-lint:latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- run: |
27+
git --version
28+
ansible-lint --version
29+
ansible-lint -v
30+
31+
ansible-syntax:
32+
runs-on: ubuntu-latest
33+
container: cytopia/ansible:latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- run: |
37+
apk add git
38+
git --version
39+
ansible-galaxy --version
40+
ansible-playbook --version
41+
ansible-playbook --syntax-check --list-tasks playbooks/*.yml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode/

.gitlab-ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
stages:
3+
- lint
4+
5+
yamllint:
6+
stage: lint
7+
image:
8+
name: cytopia/yamllint:latest
9+
entrypoint: ["/bin/ash", "-c"]
10+
script:
11+
- yamllint --version
12+
- yamllint .
13+
14+
ansible-lint:
15+
stage: lint
16+
image: pipelinecomponents/ansible-lint:latest
17+
script:
18+
- git --version
19+
- ansible-lint --version
20+
- ansible-lint
21+
- ansible-lint roles/
22+
23+
ansible-syntax:
24+
stage: lint
25+
image:
26+
name: cytopia/ansible:latest
27+
entrypoint: ["/bin/sh", "-c"]
28+
variables:
29+
ANSIBLE_ROLES_PATH: roles
30+
script:
31+
- apk add git
32+
- git --version
33+
- ansible-galaxy --version
34+
- ansible-playbook --version
35+
- ansible-galaxy role install -r roles/requirements.yml
36+
- ansible-galaxy collection install -r collections/requirements.yml
37+
- ansible-playbook --syntax-check --list-tasks playbooks/*.yml

.yamllint

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length:
6+
max: 160
7+
empty-lines:
8+
max: 1
9+
max-start: 0
10+
max-end: 1
11+
hyphens:
12+
max-spaces-after: 1
13+
indentation:
14+
spaces: 2
15+
indent-sequences: whatever
16+
check-multi-line-strings: false

README.md

Lines changed: 57 additions & 0 deletions

ansible.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[defaults]
2+
collections_paths = /etc/ansible/collections:/opt/ansible/collections:collections
3+
roles_path = /etc/ansible/roles:/opt/ansible/roles:roles
4+
5+
# You’ll also need to make sure that requiretty is disabled
6+
# in /etc/sudoers on the remote host, or become won’t work
7+
# with pipelining enabled.
8+
[ssh_connection]
9+
pipelining = True

bin/helpers/.gitkeep

Whitespace-only changes.

bin/helpers/user_repair.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# these commands are run as root
4+
# if ansible user is somehow broken or missing, execute this script to repair it
5+
6+
useradd -m ansible -s /bin/bash
7+
mkdir /home/ansible/.ssh
8+
chmod 700 /home/ansible/.ssh
9+
chown ansible:ansible /home/ansible/.ssh
10+
echo "ansible ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/ansible
11+
chmod 0440 /etc/sudoers.d/ansible
12+
echo "< place key here >" >> /home/ansible/.ssh/authorized_keys
13+
chmod 600 /home/ansible/.ssh/authorized_keys
14+
chown ansible:ansible /home/ansible/.ssh/authorized_keys

0 commit comments

Comments
 (0)