-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(254): use local ansible execution
Resolves #254.
- Loading branch information
Showing
6 changed files
with
53 additions
and
20 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
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,6 @@ | ||
#!/bin/sh | ||
|
||
export ANSIBLE_NOCOWS=1 | ||
ansible-playbook -K -i localhost, clean.yml $* | ||
|
||
rm -f ansible_inventory.ini |
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,26 @@ | ||
--- | ||
# | ||
|
||
- hosts: localhost | ||
connection: local | ||
pre_tasks: | ||
- name: Fail if Ansible version is too old | ||
fail: | ||
msg: "Workstation requires a minimum Ansible version of {{ ansible_minimum_version }}. Please update Ansible and run workstation.sh again." | ||
when: ansible_version.full is version(ansible_minimum_version, operator='lt', strict=True) | ||
- name: abort execution on 32-bit environments | ||
fail: | ||
msg: "These playbooks are now only available on 64-bit OSes" | ||
when: ansible_architecture == "i386" | ||
remote_user: ansible | ||
become: yes | ||
vars_files: | ||
- versions.yml | ||
roles: # The Alpine roles must remain first in the role list | ||
- role: "alpine/common" | ||
tags: | ||
- "alpine" | ||
- role: "alpine/xfce" | ||
tags: | ||
- "alpine" | ||
- clean |
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,17 @@ | ||
--- | ||
# | ||
|
||
- name: remove the ansible user's privileges (sudo) | ||
file: | ||
path: /etc/sudoers.d/ansible | ||
state: absent | ||
tags: | ||
- clean-legacy | ||
|
||
- name: remove the ansible user's account | ||
user: | ||
name: ansible | ||
state: absent | ||
remove: yes | ||
tags: | ||
- clean-legacy |
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,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
export ANSIBLE_NOCOWS=1 | ||
ansible-playbook --private-key=~/.ssh/ansible-key -i ansible_inventory.ini workstation.yml $* | ||
ansible-playbook -K -i localhost, workstation.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