-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fixed/import-lint
- Loading branch information
Showing
10 changed files
with
168 additions
and
19 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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Changelog | ||
|
||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) | ||
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
## master | ||
|
||
## 0.0.2 | ||
|
||
### Fixed | ||
|
||
- Fixed import lint | ||
|
||
## 0.0.1 | ||
|
||
### Added | ||
|
||
- Initial develop | ||
- Initial docs | ||
# Changelog | ||
|
||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) | ||
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
## master | ||
|
||
## 0.0.2 | ||
|
||
### Fixed | ||
|
||
- Fixed import lint | ||
### Added | ||
|
||
- Add role files | ||
|
||
## 0.0.1 | ||
|
||
### Added | ||
|
||
- Initial develop | ||
- Initial docs |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Ansible Role: files | ||
|
||
## Description | ||
|
||
Downloads a file or creates one from a structure. | ||
|
||
## Role Variables | ||
|
||
### Files | ||
|
||
List of configuration dictionary defining the content. | ||
|
||
```yml | ||
files: | ||
- type: content | ||
path: "c:\\support" | ||
name: 'test' | ||
extension: json | ||
content: | ||
HEALTHCHECK_URL: 'https://healthchecks.itigo.tech' | ||
HEALTCHECKS_CHOCO_API_KEY: hallo | ||
``` | ||
## Example Playbook | ||
```yml | ||
- hosts: all | ||
collections: | ||
- sbaerlocher.windows | ||
roles: | ||
- files | ||
``` |
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,25 @@ | ||
--- | ||
# defaults file for files | ||
|
||
# List of configuration dictionary defining the content. | ||
# The following properties are supported: | ||
# type content | url [required] | ||
# path [required] Path where the file should be saved. | ||
# name [required] File name. | ||
# extension [required] File extension the one that should have the file. | ||
# content [optional] List or dictionary of key/value pairs, when content. | ||
# url [optional] Url from where the file can be downloaded. | ||
# | ||
# Example: | ||
# | ||
# files: | ||
# - type: content | ||
# path: "c:\\support" | ||
# name: 'test' | ||
# extension: json | ||
# content: | ||
# HEALTHCHECK_URL: 'https://healthchecks.itigo.tech' | ||
# HEALTCHECKS_CHOCO_API_KEY: hallo | ||
# | ||
|
||
# files: |
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 @@ | ||
--- | ||
galaxy_info: | ||
author: Simon Baerlocher (https://sbaerlocher.ch) | ||
description: Downloads a file or creates one from a structure. | ||
license: MIT | ||
min_ansible_version: 2.9 | ||
platforms: | ||
- name: Windows | ||
versions: | ||
- all | ||
|
||
galaxy_tags: | ||
- windows | ||
- files | ||
|
||
dependencies: [] |
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 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | ||
name: yamllint | ||
platforms: | ||
- name: instance | ||
image: 'geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest' | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
scenario: | ||
name: default | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
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,5 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
roles: | ||
- role: sbaerlocher.windows.files |
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,8 @@ | ||
--- | ||
# tasks file for files | ||
|
||
- name: "Create {{ file.path }}\\{{ file.name }}.{{ file.extension }}" | ||
win_copy: | ||
dest: "{{ file.path }}\\{{ file.name }}.{{ file.extension }}" | ||
content: '{{ file.content | to_nice_json }}' | ||
state: "{{ file.state | default('present') }}" |
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,22 @@ | ||
--- | ||
# tasks file for files | ||
|
||
- name: 'include directories role' | ||
include_role: | ||
name: directories | ||
vars: | ||
directories: | ||
- main: '{{ file.path }}' | ||
loop: '{{ files }}' | ||
loop_control: | ||
loop_var: file | ||
tags: | ||
- configuration | ||
|
||
- name: 'include file type' | ||
include_tasks: '{{ file.type }}.yml' | ||
loop: '{{ files }}' | ||
loop_control: | ||
loop_var: file | ||
tags: | ||
- configuration |
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 @@ | ||
--- | ||
# tasks file for files | ||
|
||
- name: "Create {{ file.path }}\\{{ file.name }}.{{ file.extension }}" | ||
win_get_url: | ||
url: '{{ file.url }}' | ||
dest: '{{ file.path }}\\{{ file.name }}.{{ file.extension }}' | ||
when: item.state | default("present") == "present" | ||
|
||
- name: "Absent {{ file.path }}\\{{ file.name }}.{{ file.extension }}" | ||
win_file: | ||
path: "{{ file.path }}\\{{ file.name }}.{{ file.extension }}" | ||
state: absent | ||
when: | ||
- ("state" in item.keys()) | ||
- item.state == "absent" |