This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
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.
- Loading branch information
Julien Jean
committed
Jan 25, 2022
0 parents
commit 444a365
Showing
9 changed files
with
160 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ansible: | ||
./scripts/install_ansible.sh | ||
|
||
configure: ansible | ||
ansible-playbook configure.yml --ask-become-pass |
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 @@ | ||
# wsl-setup | ||
|
||
Une configuration de base pour débuter avec le WSL. | ||
|
||
# Installation du WSL | ||
|
||
Suivre la [doc dédiée à l'installation du WSL](https://docs.microsoft.com/fr-fr/learn/modules/get-started-with-windows-subsystem-for-linux/). | ||
|
||
# Configuration du WSL | ||
|
||
Clonez ce repo, puis | ||
|
||
```shell | ||
make configure | ||
``` | ||
|
||
> Sous le capot, on utilise `ansible` pour provisionner toute une suite d'outils. En faisant cela, on garantit qu'un développeur peut simplement relancer la même commande pour installer de nouveaux outils/de nouvelles dépendances. |
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,10 @@ | ||
--- | ||
|
||
- name: install required tools | ||
hosts: localhost | ||
become: yes | ||
vars: | ||
docker_compose_version: 1.29.2 | ||
docker_users: ["{{ lookup('env', 'USER') }}"] | ||
roles: | ||
- developer |
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 @@ | ||
--- | ||
|
||
- name: restart docker daemon | ||
service: | ||
name: docker | ||
state: restarted |
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,10 @@ | ||
--- | ||
|
||
- name: install terraform | ||
include_tasks: tools/terraform.yml | ||
|
||
- name: install docker | ||
include_tasks: tools/docker.yml | ||
|
||
- name: install gh cli | ||
include_tasks: tools/gh_cli.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
|
||
- name: ensure obsolete packages are absent | ||
apt: | ||
name: ['docker', 'docker-engine', 'docker.io', 'containerd', 'runc'] | ||
state: absent | ||
purge: yes | ||
|
||
- name: ensure dependencies are installed | ||
apt: | ||
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common'] | ||
state: present | ||
update_cache: yes | ||
|
||
- name: add docker apt fingerprint | ||
apt_key: | ||
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" | ||
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | ||
state: present | ||
|
||
- name: add docker apt repository | ||
apt_repository: | ||
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" | ||
state: present | ||
|
||
- name: install docker | ||
apt: | ||
name: ['docker-ce', 'docker-ce-cli', 'containerd.io'] | ||
state: present | ||
update_cache: yes | ||
|
||
- name: ensure docker group exists | ||
group: | ||
name: docker | ||
state: present | ||
|
||
- name: add users to docker group | ||
user: | ||
name: "{{ item }}" | ||
append: yes | ||
groups: docker | ||
with_items: "{{ docker_users }}" | ||
notify: restart docker daemon | ||
|
||
# docker compose | ||
- name: install docker compose | ||
get_url: | ||
url: https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-Linux-x86_64 | ||
dest: /usr/local/bin/docker-compose | ||
mode: 0755 |
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,23 @@ | ||
--- | ||
|
||
# curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | ||
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | ||
# sudo apt update | ||
# sudo apt install gh | ||
|
||
- name: add guthub cli apt key | ||
apt_key: | ||
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg | ||
state: present | ||
|
||
- name: add github cli apt repository | ||
apt_repository: | ||
repo: deb [arch=amd64] https://cli.github.com/packages stable main | ||
state: present | ||
|
||
- name: install gh cli package | ||
apt: | ||
name: | ||
- gh | ||
state: latest | ||
update_cache: 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,27 @@ | ||
--- | ||
|
||
- name: ensure requirements are present | ||
apt: | ||
name: | ||
- gnupg | ||
- software-properties-common | ||
- curl | ||
state: latest | ||
update_cache: yes | ||
|
||
- name: add hashicorp apt key | ||
apt_key: | ||
url: https://apt.releases.hashicorp.com/gpg | ||
state: present | ||
|
||
- name: add hashicorp apt repository | ||
apt_repository: | ||
repo: deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main | ||
state: present | ||
|
||
- name: install terraform package | ||
apt: | ||
name: | ||
- terraform | ||
state: latest | ||
update_cache: 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,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
which ansible | grep "ansible" &> /dev/null | ||
if [ $? == 0 ]; then | ||
echo "Ansible seems to be already installed. Skipping." | ||
exit 0 | ||
fi | ||
|
||
apt update | ||
apt install -y software-properties-common make | ||
add-apt-repository --yes --update ppa:ansible/ansible | ||
apt install -y ansible |