You've already forked ansible-role-sudo
Compare commits
15 Commits
0.1.4
...
renovate/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
41fd066542
|
|||
|
58d25578d7
|
|||
|
3af115d465
|
|||
|
a8e2ba74ee
|
|||
|
b946da2d8d
|
|||
| 79f34eb179 | |||
|
8b4aa30051
|
|||
| 75793805af | |||
|
a0eef04414
|
|||
| 29f312ef07 | |||
|
316c642cf4
|
|||
| e315f71fea | |||
|
fc9dc7a034
|
|||
| ea17bd56a5 | |||
|
dc4e741b85
|
@@ -12,9 +12,9 @@ jobs:
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.1
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- name: Run ansible-lint
|
||||
uses: ansible/ansible-lint@v25.11.0
|
||||
uses: ansible/ansible-lint@v26.1.0
|
||||
with:
|
||||
args: "--config-file .ansible-lint"
|
||||
setup_python: "true"
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.1
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v21.0.0
|
||||
with:
|
||||
globs: '**/*.md'
|
||||
|
||||
21
.gitea/workflows/release.yaml
Normal file
21
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Release Ansible Role
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release Ansible Role
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Ansible Galaxy
|
||||
run: |
|
||||
apt update --yes
|
||||
apt install --yes ansible
|
||||
- env:
|
||||
ANSIBLE_GALAXY_TOKEN: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
|
||||
name: Update Ansible Role in Ansible Galaxy
|
||||
run: |
|
||||
ansible-galaxy role import --token=${ANSIBLE_GALAXY_TOKEN} volker-raschek ${GITHUB_REPOSITORY#*/}
|
||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -3,12 +3,12 @@
|
||||
"files.associations": {
|
||||
"**/.gitea/**/*.yml": "yaml",
|
||||
"**/.gitea/**/*.yaml": "yaml",
|
||||
".drone.yml": "yaml",
|
||||
"docker-compose*.yml": "dockercompose",
|
||||
"*.yml": "ansible",
|
||||
"*.yaml": "ansible",
|
||||
".yamllint": "yaml",
|
||||
".yamllint.yml": "yaml",
|
||||
".yamllint.yaml": "yaml"
|
||||
}
|
||||
},
|
||||
"rewrap.wrappingColumn": 120
|
||||
}
|
||||
@@ -1,7 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Load variables
|
||||
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
|
||||
- name: Include OS-specific variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_facts['distribution'] }}_{{ ansible_facts['architecture'] }}.yaml"
|
||||
- "{{ ansible_facts['distribution'] }}.yaml"
|
||||
- "{{ ansible_facts['os_family'] }}_{{ ansible_facts['architecture'] }}.yaml"
|
||||
- "{{ ansible_facts['os_family'] }}.yaml"
|
||||
- main.yaml
|
||||
paths:
|
||||
- vars
|
||||
|
||||
- name: Verify variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Load variables
|
||||
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
|
||||
|
||||
- name: Verify variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_facts['distribution'] }}_verify_vars.yaml"
|
||||
- "{{ ansible_facts['os_family'] }}_verify_vars.yaml"
|
||||
- "verify_vars.yaml"
|
||||
|
||||
- name: Install sudo
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ sudo_users_package_names }}"
|
||||
|
||||
- name: Enable includedir directive
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
regexp: "^(#)+(\\s)*includedir(\\s)*/etc/sudoers.d"
|
||||
line: "#includedir /etc/sudoers.d"
|
||||
validate: 'visudo --check --file %s'
|
||||
mode: "0440"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
|
||||
- name: Flush drop-in files of sudoers.d
|
||||
ansible.builtin.file:
|
||||
state: "{{ item }}"
|
||||
path: "/etc/sudoers.d"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0750"
|
||||
with_items:
|
||||
- absent
|
||||
- directory
|
||||
|
||||
- name: "Create sudoers drop-in file to execute commands for specific unix users"
|
||||
community.general.sudoers:
|
||||
name: "{{ item.filename | default(item.user) }}"
|
||||
state: present
|
||||
user: "{{ item.user }}"
|
||||
nopassword: "{{ item.nopassword | default(false) }}"
|
||||
commands: "{{ item.commands | default('ALL') }}"
|
||||
with_items:
|
||||
- "{{ sudo_users_sudoers }}"
|
||||
when: item.user is defined and item.user | length > 0 and
|
||||
item.group is not defined and
|
||||
item.runas is not defined
|
||||
|
||||
- name: "Create sudoers drop-in file to execute commands for specific unix users as specific unix user"
|
||||
community.general.sudoers:
|
||||
name: "{{ item.filename | default(item.user) }}"
|
||||
state: present
|
||||
user: "{{ item.user }}"
|
||||
runas: "{{ item.runas }}"
|
||||
nopassword: "{{ item.nopassword | default(false) }}"
|
||||
commands: "{{ item.commands | default('ALL') }}"
|
||||
with_items:
|
||||
- "{{ sudo_users_sudoers }}"
|
||||
when: item.user is defined and item.user | length > 0 and
|
||||
item.group is not defined and
|
||||
item.runas is defined and item.runas | length > 0
|
||||
|
||||
- name: "Create sudoers drop-in file to execute commands for specific unix groups"
|
||||
community.general.sudoers:
|
||||
name: "{{ item.filename | default(item.group) }}"
|
||||
state: present
|
||||
group: "{{ item.group }}"
|
||||
nopassword: "{{ item.nopassword | default(false) }}"
|
||||
commands: "{{ item.commands | default('ALL') }}"
|
||||
with_items:
|
||||
- "{{ sudo_users_sudoers }}"
|
||||
when: item.user is not defined and
|
||||
item.group is defined and item.group | length > 0 and
|
||||
item.runas is not defined
|
||||
|
||||
- name: "Create sudoers drop-in file to execute commands for specific unix groups as specifix unix user"
|
||||
community.general.sudoers:
|
||||
name: "{{ item.filename | default(item.group) }}"
|
||||
state: present
|
||||
group: "{{ item.group }}"
|
||||
runas: "{{ item.runas }}"
|
||||
nopassword: "{{ item.nopassword | default(false) }}"
|
||||
commands: "{{ item.commands | default('ALL') }}"
|
||||
with_items:
|
||||
- "{{ sudo_users_sudoers }}"
|
||||
when: item.user is not defined and
|
||||
item.group is defined and item.group | length > 0 and
|
||||
item.runas is defined and item.runas | length > 0
|
||||
Reference in New Issue
Block a user