Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ansible so that variables.yaml can be modified and not show changes #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
*This will install a WSL using Ubuntu with the name bingobongo, the user dulli and the vhdx file will be located at c:\wsldistros\bingobongo*

## wsl/ansible
**variables.yaml**
**variables.example.yaml**

Example:
```
Expand All @@ -34,6 +34,8 @@ install_ruby: true
install_nodejs: true
```

Create **variables.yaml** otherwise the example will be used.

### run ansible
1st Close the WSL after creation in MS Terminal using [x] and reopen it again and then execute
```
Expand Down
1 change: 1 addition & 0 deletions wsl/ansible/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
variables.yaml
9 changes: 7 additions & 2 deletions wsl/ansible/playbook.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
- name: Works on my machine
hosts: 127.0.0.1
connection: local
vars_files:
- ./variables.yaml
become: true
gather_facts: true

tasks:
- name: Load vars file - fallback to example if not exists
include_vars: "{{ item }}"
with_first_found:
- files:
- "variables.yaml"
- "variables.example.yaml"

- name: Smalltalk with the repos if older 1h
register: systemupdate
apt:
Expand Down
File renamed without changes.