Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d4291453cc | |||
| 87ead41f5e | |||
| d9d757bdc0 | |||
| 28c32a767f | |||
| 4ea9fd1142 | |||
| fb5c9425e9 |
@@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
exclude_paths:
|
exclude_paths:
|
||||||
|
- .cache/
|
||||||
- ./molecule
|
- ./molecule
|
||||||
- ./.travis.yml
|
- ./.travis.yml
|
||||||
- ./.github
|
- ./.github
|
||||||
parseable: true
|
parseable: true
|
||||||
skip_list:
|
skip_list:
|
||||||
- '204'
|
- '204'
|
||||||
|
- 'no-handler'
|
||||||
use_default_rules: true
|
use_default_rules: true
|
||||||
verbosity: 1
|
verbosity: 1
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [1.1.1](https://git.laurivan.com/Dev/ansible-role-unifi-controller/compare/v1.0.0...v1.1.1) (2023-09-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Linting. ([28c32a7](https://git.laurivan.com/Dev/ansible-role-unifi-controller/commit/28c32a767f98bca403abedfdfe3e38ca9b665c31))
|
||||||
|
|
||||||
|
## [1.0.0](https://git.laurivan.com/Dev/ansible-role-unifi-controller/compare/v1.1.0...v1.0.0) (2023-09-21)
|
||||||
|
|
||||||
## 1.1.0 (2023-09-21)
|
## 1.1.0 (2023-09-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ The following fields are internal. You can change them to further customise how
|
|||||||
- `unifi_skeleton_paths`: The list of paths to be created by the role
|
- `unifi_skeleton_paths`: The list of paths to be created by the role
|
||||||
- `unifi_configuration_files`: The configuration files generated by the role
|
- `unifi_configuration_files`: The configuration files generated by the role
|
||||||
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
You need a machine with docker and docker-compose installed.
|
You need a machine with docker and docker-compose installed.
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
## General
|
## General
|
||||||
unifi_image: lscr.io/linuxserver/unifi-controller:latest
|
unifi_image: lscr.io/linuxserver/unifi-network-application:latest
|
||||||
|
unifi_container_name: unifi-network-application
|
||||||
|
|
||||||
unifi_uid: 1000
|
unifi_uid: 1000
|
||||||
unifi_gid: 1000
|
unifi_gid: 1000
|
||||||
unifi_mem_limit: 1024
|
unifi_mem_limit: 1024
|
||||||
unifi_mem_startup: 1024
|
unifi_mem_startup: 1024
|
||||||
|
unifi_tz: "Etc/UTC"
|
||||||
|
|
||||||
unifi_volume: "unifi"
|
unifi_volume: "unifi"
|
||||||
|
|
||||||
@@ -22,6 +24,13 @@ unifi_http_port_8880: 8880
|
|||||||
unifi_http_port_6789: 6789
|
unifi_http_port_6789: 6789
|
||||||
unifi_http_port_5514: 5514
|
unifi_http_port_5514: 5514
|
||||||
|
|
||||||
|
unifi_mongo_user: unifi
|
||||||
|
unifi_mongo_pass:
|
||||||
|
unifi_mongo_host: unifi-db
|
||||||
|
unifi_mongo_port: 27017
|
||||||
|
unifi_nongo_db_name: unifi
|
||||||
|
unifi_mongo_auth_source: admin
|
||||||
|
unifi_mongo_tls:
|
||||||
|
|
||||||
# Unifi-Controller paths
|
# Unifi-Controller paths
|
||||||
unifi_root_path: /var/local
|
unifi_root_path: /var/local
|
||||||
@@ -33,7 +42,7 @@ unifi_config_path: "{{ unifi_root_path }}/conf/unifi-controller"
|
|||||||
unifi_skeleton_paths:
|
unifi_skeleton_paths:
|
||||||
- "{{ unifi_config_path }}"
|
- "{{ unifi_config_path }}"
|
||||||
|
|
||||||
# Add more templates to be copied into the config
|
# Add more templates to be copied into the config
|
||||||
unifi_configuration_files:
|
unifi_configuration_files:
|
||||||
- "docker-compose.yml"
|
- "docker-compose.yml"
|
||||||
- "env.unifi-controller.conf"
|
- "env.unifi-controller.conf"
|
||||||
|
|||||||
43
git-conventional-commits.yaml
Normal file
43
git-conventional-commits.yaml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
convention:
|
||||||
|
commitTypes:
|
||||||
|
- feat
|
||||||
|
- fix
|
||||||
|
- perf
|
||||||
|
- refactor
|
||||||
|
- style
|
||||||
|
- test
|
||||||
|
- build
|
||||||
|
- ops
|
||||||
|
- docs
|
||||||
|
- chore
|
||||||
|
- merge
|
||||||
|
- revert
|
||||||
|
commitScopes: []
|
||||||
|
releaseTagGlobPattern: v[0-9]*.[0-9]*.[0-9]*
|
||||||
|
changelog:
|
||||||
|
commitTypes:
|
||||||
|
- feat
|
||||||
|
- fix
|
||||||
|
- perf
|
||||||
|
- merge
|
||||||
|
includeInvalidCommits: true
|
||||||
|
commitIgnoreRegexPattern: "^WIP "
|
||||||
|
headlines:
|
||||||
|
feat: Features
|
||||||
|
fix: Bug Fixes
|
||||||
|
perf: Performance Improvements
|
||||||
|
merge: Merges
|
||||||
|
breakingChange: BREAKING CHANGES
|
||||||
|
|
||||||
|
## GitHub
|
||||||
|
# commitUrl: https://github.com/ACCOUNT/REPOSITORY/commit/%commit%
|
||||||
|
# commitRangeUrl: https://github.com/ACCOUNT/REPOSITORY/compare/%from%...%to%?diff=split
|
||||||
|
|
||||||
|
## GitHub Issues
|
||||||
|
# issueRegexPattern: "#[0-9]+"
|
||||||
|
# issueUrl: https://github.com/ACCOUNT/REPOSITORY/issues/%issue%
|
||||||
|
|
||||||
|
## Jira Issues
|
||||||
|
# issueRegexPattern: "[A-Z][A-Z0-9]+-[0-9]+"
|
||||||
|
# issueUrl: https://WORKSPACE.atlassian.net/browse/%issue%
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Check if the docker-compose file exists."
|
- name: "UNIFI-CONTROLLER | Check if the docker-compose file exists."
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ unifi_config_path | expanduser | realpath }}/docker-compose.yml"
|
path: "{{ unifi_config_path | expanduser | realpath }}/docker-compose.yml"
|
||||||
register: "docker_compose_file"
|
register: "docker_compose_file"
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Remove docker-compose."
|
- name: "UNIFI-CONTROLLER | Remove docker-compose."
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
when: "not docker_sock_stat.stat.exists"
|
when: "not docker_sock_stat.stat.exists"
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Update apt cache."
|
- name: "UNIFI-CONTROLLER | Update apt cache."
|
||||||
ansible.builtin.apt: update_cache=yes cache_valid_time=600
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
cache_valid_time: 600
|
||||||
when: "ansible_os_family == 'Debian'"
|
when: "ansible_os_family == 'Debian'"
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Install python requests"
|
- name: "UNIFI-CONTROLLER | Install python requests"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
roles:
|
roles:
|
||||||
- "geerlingguy.docker"
|
- name: "geerlingguy.docker"
|
||||||
collections: []
|
collections: []
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
---
|
|
||||||
# This is an example playbook to execute goss tests.
|
|
||||||
# Tests need distributed to the appropriate ansible host/groups
|
|
||||||
# prior to execution by `goss validate`.
|
|
||||||
|
|
||||||
- name: Verify unifi-controller
|
|
||||||
hosts:
|
|
||||||
- "unifi-controller"
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
goss_version: "v0.3.16"
|
|
||||||
goss_arch: "amd64"
|
|
||||||
goss_dst: "/usr/local/bin/goss"
|
|
||||||
goss_sha256sum: "827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb"
|
|
||||||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
|
|
||||||
goss_test_directory:" /tmp"
|
|
||||||
goss_format: "documentation"
|
|
||||||
|
|
||||||
vars_files:
|
|
||||||
- ../../defaults/main.yml
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: "UNIFI-CONTROLLER | Download and install Goss"
|
|
||||||
get_url:
|
|
||||||
url: "{{ goss_url }}"
|
|
||||||
dest: "{{ goss_dst }}"
|
|
||||||
checksum: "sha256:{{ goss_sha256sum }}"
|
|
||||||
mode: 0755
|
|
||||||
register: "download_goss"
|
|
||||||
until: "download_goss is succeeded"
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Copy Goss tests to remote"
|
|
||||||
template:
|
|
||||||
src: "{{ item }}"
|
|
||||||
dest: "{{ goss_test_directory }}/{{ item | basename }}"
|
|
||||||
with_fileglob:
|
|
||||||
- "tests/test_*.yml"
|
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Register test files"
|
|
||||||
shell: "ls {{ goss_test_directory }}/test_*.yml"
|
|
||||||
register: "test_files"
|
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Execute Goss tests"
|
|
||||||
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}"
|
|
||||||
register: "test_results"
|
|
||||||
with_items: "{{ test_files.stdout_lines }}"
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Display details about the Goss results"
|
|
||||||
debug:
|
|
||||||
msg: "{{ item.stdout_lines }}"
|
|
||||||
with_items: "{{ test_results.results }}"
|
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Fail when tests fail"
|
|
||||||
fail:
|
|
||||||
msg: "Goss failed to validate"
|
|
||||||
when: item.rc != 0
|
|
||||||
with_items: "{{ test_results.results }}"
|
|
||||||
@@ -15,10 +15,9 @@
|
|||||||
- name: "UNIFI-CONTROLLER | Write configuration files"
|
- name: "UNIFI-CONTROLLER | Write configuration files"
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "{{ item }}.j2"
|
src: "{{ item }}.j2"
|
||||||
dest: "{{ unifi_config_path | expanduser | realpath }}/{{ item }}"
|
dest: "{{ unifi_config_path | expanduser | realpath }}/{{ item }}"
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ unifi_configuration_files }}"
|
- "{{ unifi_configuration_files }}"
|
||||||
tags:
|
tags:
|
||||||
- unifi_configure
|
- unifi_configure
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Configure"
|
- name: "UNIFI-CONTROLLER | Configure"
|
||||||
import_tasks: config.yml
|
ansible.builtin.import_tasks: config.yml
|
||||||
tags:
|
tags:
|
||||||
- unifi_configure
|
- unifi_configure
|
||||||
|
|
||||||
- name: "UNIFI-CONTROLLER | Install"
|
- name: "UNIFI-CONTROLLER | Install"
|
||||||
import_tasks: install.yml
|
ansible.builtin.import_tasks: install.yml
|
||||||
tags:
|
tags:
|
||||||
- unifi_install
|
- unifi_install
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# unifi-controller docker compose
|
# unifi-controller docker compose
|
||||||
|
---
|
||||||
version: '3.9'
|
version: '3.9'
|
||||||
services:
|
services:
|
||||||
unifi-controller:
|
unifi-controller:
|
||||||
image: "{{ unifi_image }}"
|
image: "{{ unifi_image }}"
|
||||||
container_name: unifi-controller-service
|
container_name: "{{ unifi_container_name }}"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- "{{ unifi_config_path | expanduser }}/env.unifi-controller.conf"
|
- "{{ unifi_config_path | expanduser }}/env.unifi-controller.conf"
|
||||||
|
|||||||
@@ -5,4 +5,16 @@ PUID={{ unifi_gid }}
|
|||||||
MEM_LIMIT={{ unifi_mem_limit }}
|
MEM_LIMIT={{ unifi_mem_limit }}
|
||||||
MEM_STATUP={{ unifi_mem_startup }}
|
MEM_STATUP={{ unifi_mem_startup }}
|
||||||
|
|
||||||
|
TZ={{ unifi_tz }}
|
||||||
|
MONGO_USER={{ unifi_mongo_user }}
|
||||||
|
MONGO_PASS={{ unifi_mongo_pass }}
|
||||||
|
MONGO_HOST={{ unifi_mongo_host }}
|
||||||
|
MONGO_PORT={{ unifi_mongo_port }}
|
||||||
|
MONGO_DBNAME={{ unifi_nongo_db_name }}
|
||||||
|
MONGO_AUTHSOURCE={{ unifi_mongo_auth_source }}
|
||||||
|
{% if unifi_mongo_tls is defined -%}
|
||||||
|
MONGO_TLS= {{ unifi_mongo_tls }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ ansible==8.3.0
|
|||||||
molecule==6.0.2
|
molecule==6.0.2
|
||||||
docker==6.1.3
|
docker==6.1.3
|
||||||
molecule-docker==2.1.0
|
molecule-docker==2.1.0
|
||||||
ansible-lint==6.19.0
|
ansible-lint==6.20.0
|
||||||
yamllint==1.32.0
|
yamllint==1.32.0
|
||||||
Reference in New Issue
Block a user