-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ensure it works on noble
- Loading branch information
Showing
50 changed files
with
609 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
exclude_paths: | ||
- ".github" | ||
- "/docker-compose.yml" | ||
- "/docker-compose.*.yml" | ||
|
||
kinds: | ||
- playbook: "tests/redmine_mysql.yml" | ||
- playbook: "tests/redmine_postgresql.yml" | ||
|
||
skip_list: | ||
- package-latest # we don't change this role with all the versions | ||
- latest[git] # same | ||
- role-name[path] # we nest roles here to avoid 1000 dependencies | ||
- var-naming[pattern] # we use uppercase variables for stored facts | ||
- var-naming[no-role-prefix] # our role variables don't follow this pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "redmine-ansible-dev", | ||
"dockerComposeFile": [ | ||
"../docker-compose.yml", | ||
"docker-compose.override.yml" | ||
], | ||
"service": "ansible", | ||
"overrideCommand": true, | ||
"containerUser": "root", | ||
"workspaceFolder": "/etc/ansible/roles/hicknhack-software.redmine", | ||
// "capAdd": ["SYS_ADMIN", "SYS_RESOURCE"], | ||
// "securityOpt": ["seccomp=unconfined", "label=disable", "apparmor=unconfined"], | ||
"updateRemoteUserUID": true, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"redhat.ansible" | ||
], | ||
"settings": { | ||
"files.associations": { | ||
"**/defaults/*.yml": "ansible", | ||
"**/handlers/*.yml": "ansible", | ||
"**/tasks/*.yml": "ansible", | ||
"**/vars/*.yml": "ansible", | ||
"**/templates/*.j2": "ansible-jinja" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
services: | ||
ansible: | ||
image: "ghcr.io/ansible/community-ansible-dev-tools:latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Ansible Lint | ||
|
||
on: push | ||
|
||
jobs: | ||
ansible-lint: | ||
name: "Run Ansible Lint" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Make Symlink | ||
run: >- | ||
mkdir -p /home/runner/.ansible/roles | ||
&& ln -s $(pwd) /home/runner/.ansible/roles/hicknhack-software.redmine | ||
- name: Run Ansible Lint | ||
uses: ansible/ansible-lint@main | ||
with: | ||
requirements_file: "requirements.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test with Docker | ||
|
||
on: push | ||
|
||
jobs: | ||
test-redmine: | ||
name: "Redmine on Docker" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- distro_name: noble | ||
- distro_name: jammy | ||
- distro_name: focal | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
COMPOSE_FILE: "-f docker-compose.yml -f tests/docker-compose.${{ matrix.distro_name }}.yml" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate SSH key | ||
run: sudo tests/make_sshkey.sh | ||
|
||
- name: Run Ansible | ||
run: sudo docker compose ${{ env.COMPOSE_FILE }} run --quiet-pull --rm --env ANSIBLE_FORCE_COLOR=True ansible | ||
|
||
- name: Check Idempotence | ||
shell: bash | ||
run: >- | ||
sudo docker compose ${{ env.COMPOSE_FILE }} run --rm --env ANSIBLE_FORCE_COLOR=True ansible | tee >(sed "s/\\x1B\\[\\([0-9]\\{1,2\}\\(;[0-9]\\{1,2\\}\\)\\?\\)\\?[mGK]//g" | cat >/tmp/output); | ||
cat /tmp/output | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.retry | ||
tests/docker-sshkey* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"ansible.python.interpreterPath": "/bin/python3", | ||
"files.associations": { | ||
"**/defaults/*.yml": "ansible", | ||
"**/handlers/*.yml": "ansible", | ||
"**/tasks/*.yml": "ansible", | ||
"**/vars/*.yml": "ansible", | ||
"**/templates/*.j2": "ansible-jinja" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
- name: restart | ||
service: | ||
- name: Restart | ||
ansible.builtin.service: | ||
name: "{{ APACHE_SERVER_SERVICE }}" | ||
state: "restarted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
- name: restart | ||
service: | ||
- name: Restart | ||
ansible.builtin.service: | ||
name: "{{ APACHE_SERVER_SERVICE }}" | ||
state: "restarted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,45 @@ | ||
--- | ||
- name: Add repo | ||
apt_repository: | ||
ansible.builtin.apt_repository: | ||
repo: "{{ reminde_apache_git_repository }}" | ||
|
||
- name: Install packages | ||
apt: | ||
ansible.builtin.apt: | ||
name: "{{ redmine_apache_git_packages }}" | ||
update_cache: yes | ||
update_cache: true | ||
state: latest | ||
cache_valid_time: 86400 | ||
notify: restart | ||
notify: Restart | ||
|
||
- name: Apache modules | ||
apache2_module: | ||
community.general.apache2_module: | ||
name: "{{ item }}" | ||
with_flattened: | ||
- "{{ redmine_apache_git_modules }}" | ||
- "{{ redmine_apache_git_https_fix_modules if redmine_apache_git_https_fix else [] }}" | ||
notify: restart | ||
loop: "{{ [redmine_apache_git_modules, (redmine_apache_git_https_fix_modules if redmine_apache_git_https_fix else [])] | flatten }}" | ||
notify: Restart | ||
|
||
- name: folder | ||
file: | ||
- name: Git Folder | ||
ansible.builtin.file: | ||
dest: "{{ redmine_apache_git_folder }}" | ||
state: directory | ||
owner: "{{ redmine_apache_git_folder_user }}" | ||
group: "{{ redmine_apache_git_folder_group }}" | ||
mode: "2775" # include the change group bit | ||
|
||
- name: Create script | ||
copy: | ||
ansible.builtin.copy: | ||
src: "git_createrep.sh" | ||
dest: "{{ redmine_apache_git_folder }}/{{ redmine_apache_git_create_script_name }}" | ||
mode: "700" | ||
|
||
- name: Fix permission script | ||
copy: | ||
ansible.builtin.copy: | ||
src: "git_fixpermissions.sh" | ||
dest: "{{ redmine_apache_git_folder }}/{{ redmine_apache_git_fix_script_name }}" | ||
mode: "700" | ||
|
||
- name: Apache conf | ||
template: | ||
ansible.builtin.template: | ||
dest: "{{ redmine_apache_git_vhost_path }}/{{ redmine_apache_git_config_name }}.conf" | ||
src: "redmine_git.conf.j2" | ||
notify: restart | ||
mode: "644" | ||
notify: Restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
- name: restart apache | ||
service: | ||
- name: Restart apache | ||
ansible.builtin.service: | ||
name: "{{ APACHE_SERVER_SERVICE }}" | ||
state: "restarted" |
Oops, something went wrong.