-
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.
refactor(setup): split all roles into main (install) and clean files
- Loading branch information
Showing
11 changed files
with
160 additions
and
61 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,6 +1,4 @@ | ||
#!/bin/sh | ||
|
||
export ANSIBLE_NOCOWS=1 | ||
ansible-playbook -K -i localhost, clean.yml $* | ||
|
||
rm -f ansible_inventory.ini | ||
ansible-playbook -K -i localhost, -e GITHUB_API_TOKEN=$GITHUB_API_TOKEN clean.yaml $* |
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 @@ | ||
--- | ||
- import_playbook: "roles.yaml" | ||
vars: | ||
tasks_from_file: "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,4 @@ | ||
#!/bin/sh | ||
|
||
export ANSIBLE_NOCOWS=1 | ||
ansible-playbook -K -i localhost, -e GITHUB_API_TOKEN=$GITHUB_API_TOKEN install.yaml $* |
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 @@ | ||
--- | ||
- import_playbook: "roles.yaml" | ||
vars: | ||
tasks_from_file: "main" | ||
|
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,66 @@ | ||
--- | ||
|
||
# Workstation set-up that's done system-wide (and requires root privileges) | ||
|
||
- 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"' | ||
become: yes | ||
vars_files: | ||
- "config.yaml" | ||
- "versions.yaml" | ||
tasks: | ||
- import_role: | ||
name: "setup" | ||
tasks_from: "{{ tasks_from_file }}-system" | ||
- import_role: | ||
name: "common" | ||
tasks_from: "{{ tasks_from_file }}" | ||
- import_role: | ||
name: "browser" | ||
tasks_from: "{{ tasks_from_file }}" | ||
- import_role: | ||
name: "communication" | ||
tasks_from: "{{ tasks_from_file }}" | ||
- import_role: | ||
name: "multimedia" | ||
tasks_from: "{{ tasks_from_file }}" | ||
- import_role: | ||
name: "development" | ||
tasks_from: "{{ tasks_from_file }}" | ||
- import_role: | ||
name: "containerization" | ||
tasks_from: "{{ tasks_from_file }}" | ||
|
||
# Workstation set-up that's done as the current user | ||
|
||
- 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"' | ||
become: no | ||
vars_files: | ||
- "config.yaml" | ||
- "versions.yaml" | ||
tasks: | ||
- import_role: | ||
name: "setup" | ||
tasks_from: "{{ tasks_from_file }}-user" | ||
- import_role: | ||
name: "asdf" | ||
tasks_from: "{{ tasks_from_file }}" |
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,15 @@ | ||
--- | ||
|
||
# Remove the privileged ansible user which was created by earlier versions | ||
# of workstation (before Ansible supported local execution). | ||
|
||
- name: "remove the ansible user's privileges (sudo)" | ||
file: | ||
path: "/etc/sudoers.d/ansible" | ||
state: "absent" | ||
|
||
- name: "remove the ansible user's account" | ||
user: | ||
name: "ansible" | ||
state: "absent" | ||
remove: yes |
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 @@ | ||
--- |
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,25 @@ | ||
--- | ||
|
||
# asdf - the multiple runtime version manager | ||
|
||
- name: "install asdf" | ||
git: | ||
repo: "https://github.com/asdf-vm/asdf.git" | ||
dest: "~/.asdf" | ||
# version: "{{ asdf_version }}" | ||
version: "v0.12.0" | ||
update: no | ||
register: "install_asdf_result" | ||
tags: | ||
- "asdf" | ||
- "packaging" | ||
- "setup" | ||
|
||
- name: "update asdf to the latest version" | ||
command: "~/.asdf/bin/asdf update" | ||
register: "asdf_update_result" | ||
changed_when: "'Previous HEAD position was' in asdf_update_result.stderr" | ||
tags: | ||
- "asdf" | ||
- "packaging" | ||
- "setup" |
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