Compare commits
5 Commits
581422f899
...
9369d7389d
| Author | SHA1 | Date | |
|---|---|---|---|
| 9369d7389d | |||
| fb6fd031f4 | |||
| 13112a6a53 | |||
| 058a254a89 | |||
| 8d8ca0ef52 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
||||
ext_roles/*
|
||||
!ext_roles/.gitkeep
|
||||
test.yml
|
||||
.ansible/*
|
||||
|
||||
# pyenv
|
||||
.venv/*
|
||||
|
||||
13
README.md
13
README.md
@@ -8,11 +8,14 @@
|
||||
```
|
||||
|
||||
this ansible collection primarily aims to provide common roles that i've been building
|
||||
for either my home or the wululu web network and systems.
|
||||
for either my home or the wululu web network and systems.
|
||||
|
||||
by publishing it i hope it can be useful for anyone looking for inspiration
|
||||
or even roles ready-to-go.
|
||||
or even roles ready-to-go.
|
||||
|
||||
please mind that everything in this collection mainly focuses debian as a server operating system.
|
||||
thus i will not add features specific to other operating systems unless i really need to.
|
||||
thus i will not add features specific to other operating systems unless i really need to.
|
||||
|
||||
if you have any questions or suggestions feel free to get in touch with me.
|
||||
|
||||
## contents
|
||||
@@ -23,10 +26,10 @@ if you have any questions or suggestions feel free to get in touch with me.
|
||||
* **docker** – a docker install role to install docker-ce engine [🠞README](roles/docker/README.md)
|
||||
|
||||
### playbooks
|
||||
* **test_connection.yml** – a playbook to test ansible and connectivity by running the `test` and the role
|
||||
* **test_connection.yml** – a playbook to test ansible and connectivity by running ansible pings and the role `test`.
|
||||
|
||||
## usage
|
||||
to use a **playbook** provided with this collection you can use `import_playbook`:
|
||||
to use a **playbook** provided with this collection you can use `import_playbook`:
|
||||
```yaml
|
||||
- ansible.builtin.import_playbook: dede.common.test_connection.yml
|
||||
```
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace: dede
|
||||
name: common
|
||||
|
||||
# The version of the collection. Must be compatible with semantic versioning
|
||||
version: 0.3.0
|
||||
version: 0.3.1
|
||||
|
||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||
readme: README.md
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
ansible==11.1.0
|
||||
ansible-compat==24.10.0
|
||||
ansible-core==2.18.1
|
||||
ansible-lint==24.12.2
|
||||
attrs==24.3.0
|
||||
black==24.10.0
|
||||
bracex==2.5.post1
|
||||
cffi==1.17.1
|
||||
click==8.1.8
|
||||
cryptography==44.0.0
|
||||
filelock==3.16.1
|
||||
importlib_metadata==8.5.0
|
||||
Jinja2==3.1.5
|
||||
jsonschema==4.23.0
|
||||
jsonschema-specifications==2024.10.1
|
||||
MarkupSafe==3.0.2
|
||||
mypy-extensions==1.0.0
|
||||
packaging==24.2
|
||||
pathspec==0.12.1
|
||||
platformdirs==4.3.6
|
||||
pycparser==2.22
|
||||
PyYAML==6.0.2
|
||||
referencing==0.35.1
|
||||
resolvelib==1.0.1
|
||||
rpds-py==0.22.3
|
||||
ruamel.yaml==0.18.6
|
||||
subprocess-tee==0.4.2
|
||||
wcmatch==10.0
|
||||
yamllint==1.35.1
|
||||
zipp==3.21.0
|
||||
2
requirements-raw.txt
Normal file
2
requirements-raw.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
ansible
|
||||
ansible-lint
|
||||
@@ -1,2 +1,33 @@
|
||||
ansible
|
||||
ansible-lint
|
||||
ansible==12.2.0
|
||||
ansible-compat==25.8.2
|
||||
ansible-core==2.19.4
|
||||
ansible-lint==25.9.2
|
||||
attrs==25.4.0
|
||||
black==25.9.0
|
||||
bracex==2.6
|
||||
cffi==2.0.0
|
||||
click==8.3.0
|
||||
cryptography==46.0.3
|
||||
distro==1.9.0
|
||||
filelock==3.20.0
|
||||
importlib_metadata==8.7.0
|
||||
Jinja2==3.1.6
|
||||
jsonschema==4.25.1
|
||||
jsonschema-specifications==2025.9.1
|
||||
MarkupSafe==3.0.3
|
||||
mypy_extensions==1.1.0
|
||||
packaging==25.0
|
||||
pathspec==0.12.1
|
||||
platformdirs==4.5.0
|
||||
pycparser==2.23
|
||||
pytokens==0.3.0
|
||||
PyYAML==6.0.3
|
||||
referencing==0.37.0
|
||||
resolvelib==1.2.1
|
||||
rpds-py==0.28.0
|
||||
ruamel.yaml==0.18.16
|
||||
ruamel.yaml.clib==0.2.14
|
||||
subprocess-tee==0.4.2
|
||||
wcmatch==10.1
|
||||
yamllint==1.37.1
|
||||
zipp==3.23.0
|
||||
|
||||
@@ -15,19 +15,24 @@
|
||||
name: "{{ locale_config_language }}"
|
||||
|
||||
- name: get current locale and language configuration
|
||||
register: locale_status
|
||||
register: locale_config_status
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
ansible.builtin.command:
|
||||
cmd: localectl status
|
||||
|
||||
- name: set fact
|
||||
- name: remember current LANG config
|
||||
when: not locale_config_status is skipped
|
||||
ansible.builtin.set_fact:
|
||||
locale_lang: "{{ locale_status.stdout | regex_search('LANG=([^\n]+)', '\\1') | first }}"
|
||||
|
||||
locale_config_current: "{{ locale_config_status.stdout | regex_search('LANG=([^\n]+)', '\\1') | first }}"
|
||||
|
||||
- name: print current config
|
||||
ansible.builtin.debug:
|
||||
msg: "LANG={{ locale_config_current }}"
|
||||
|
||||
- name: set locale to '{{ locale_config_locale }}'
|
||||
become: true
|
||||
changed_when: locale_lang != locale_config_locale
|
||||
changed_when: locale_config_current != locale_config_locale
|
||||
ansible.builtin.command:
|
||||
cmd: localectl set-locale LANG={{ locale_config_locale }}
|
||||
|
||||
@@ -35,6 +40,6 @@
|
||||
become: true
|
||||
changed_when: locale_language != locale_config_language
|
||||
vars:
|
||||
locale_language: "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) | first }}"
|
||||
locale_language: "{{ locale_config_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_config_current], true) | first }}"
|
||||
ansible.builtin.command:
|
||||
cmd: localectl set-locale LANGUAGE={{ locale_config_language }}
|
||||
|
||||
@@ -41,13 +41,13 @@ create_virtualenv() {
|
||||
# function to install python requirements
|
||||
install_requirements() {
|
||||
check_command "pip"
|
||||
echo -e "${BLUE}installing python requirements from requirements-freeze.txt...${NC}"
|
||||
echo -e "${BLUE}installing python requirements from requirements.txt...${NC}"
|
||||
source $VENV_DIR/bin/activate
|
||||
pip install --upgrade pip
|
||||
if [ -f "requirements-freeze.txt" ]; then
|
||||
pip install -r requirements-freeze.txt
|
||||
if [ -f "requirements.txt" ]; then
|
||||
pip install -r requirements.txt
|
||||
else
|
||||
echo -e "${YELLOW}requirements-freeze.txt not found. skipping python requirements installation.${NC}"
|
||||
echo -e "${YELLOW}requirements.txt not found. skipping python requirements installation.${NC}"
|
||||
fi
|
||||
deactivate
|
||||
}
|
||||
Reference in New Issue
Block a user