Skip to content

Commit

Permalink
Merge pull request #54 from bulch/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bulch authored Feb 16, 2025
2 parents c13ec42 + e3d218e commit 944594b
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 19 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exclude_paths:
- .cache/ # implicit unless exclude_paths is defined in config
- test/fixtures/formatting-before/
- test/fixtures/formatting-prettier/
- .ansible/collections
# parseable: true
# quiet: true
# strict: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
exit_code=0
expected_exit_code=0
ansible-lint || exit_code=$?
ansible-lint --ignore-file .ansible-lint-ignore --config-file .ansible-lint . || exit_code=$?
if [ "$exit_code" != "$expected_exit_code" ]; then echo "Command failed: got '$exit_code', expected '$expected_exit_code'"; exit 1; fi
molecule:
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,30 @@ None.

## Role install

```
```bash
ansible-galaxy role install bulch.rsync_server
```

## Role Variables

Default varibles
Default varibles in file [defaults/main.yml](defaults/main.yml)

```
```yaml
---
# defaults file for rsync_server
rsync_config_file: "/etc/rsyncd.conf"
rsync_config_port: 873
rsync_server_timeout: 300
rsync_server_max_connections: 2
rsync_packages:
- rsync
rsync_config_manage: []
```
## Example Playbook
```
```yaml
---
- name: Example Playbook
hosts: all
Expand All @@ -49,14 +53,14 @@ rsync_config_manage: []
- rsync_server
vars:
rsync_config_manage:
- name: "example-storage"
configs:
comment: "Example storage"
path: "/var/www/example-storage"
hosts_allow: ["*"]
secrets:
user: "{{ my_secter_rsync_user }}"
password: "{{ my_secter_rsync_password }}"
- name: "example-storage"
configs:
comment: "Example storage"
path: "/var/www/example-storage"
hosts_allow: ["*"]
secrets:
user: "{{ my_secter_rsync_user }}"
password: "{{ my_secter_rsync_password }}"
```
Rsync list for test
Expand Down
14 changes: 14 additions & 0 deletions ansible-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---

skip_list:
- 'var-naming'
- 'no-handler'
- '503' # no-handler code
- 'role-name'
- '106'
- 'ignore-errors'
- 'yaml'
- '204' # line length => checked by yamllint
- 'name[template]'
- 'run-once[play]' # only used in molecule
- 'run-once[task]' # only used in molecule
5 changes: 5 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Fail if molecule group is missing
hosts: localhost
vars:
molecule_inventory:
all:
hosts: {}
molecule: {}
tasks:
- name: Print some info
ansible.builtin.debug:
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ verifier:
lint: |
set -e
yamllint .
ansible-lint .
ansible-lint
5 changes: 5 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Fail if molecule group is missing
hosts: localhost
vars:
molecule_inventory:
all:
hosts: {}
molecule: {}
tasks:
- name: Print some info
ansible.builtin.debug:
Expand Down
5 changes: 1 addition & 4 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
roles: []
collections:
- name: community.docker
version: ">=3.10.4"
- name: community.general
collections: []
2 changes: 1 addition & 1 deletion templates/etc-rsyncd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% for item in rsync_config_manage | default([]) %}
[{{ item.name }}]
path = {{ item.configs.path }}
comment = {{ item.configs.comment | default("{{ item.name }} - server rsync") }}
comment = {{ item.configs.comment | default(item.name + " - server rsync") }}
auth users = {{ item.secrets.user }}
uid = {{ item.configs.uid | default('nobody') }}
gid = {{ item.configs.gid | default('nogroup') }}
Expand Down

0 comments on commit 944594b

Please sign in to comment.