From 81c63724d73e32f3f93b245eac4bc8b7155c7467 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 15 Nov 2019 23:44:15 +0000 Subject: [PATCH] Add installation for commonly used sotfware --- dotfiles.yml | 1 + roles/git/tasks/main.yml | 11 +++++++++++ roles/packages/tasks/main.yml | 16 ++++++++++++++++ roles/python/tasks/main.yml | 9 +++++++++ roles/tmux/tasks/main.yml | 9 +++++++++ roles/vim/tasks/main.yml | 9 +++++++++ 6 files changed, 55 insertions(+) create mode 100644 roles/packages/tasks/main.yml diff --git a/dotfiles.yml b/dotfiles.yml index 89f711d..fd67526 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -2,6 +2,7 @@ - name: Set up development machine hosts: localhost roles: + - packages - bin - bash - dircolors diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index cb2727d..4228cd4 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -1,4 +1,15 @@ --- +- name: Install git (Debian) + when: ansible_os_family == "Debian" + become: yes + apt: name={{ item }} state=latest update_cache=yes + loop: [git, git-crypt] + +- name: Install git (macOS) + when: ansible_os_family == "Darwin" + homebrew: name={{ item }} state=latest + loop: [git, git-crypt] + - name: Create the git config directory file: path: ~/.config/git diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml new file mode 100644 index 0000000..5fa4406 --- /dev/null +++ b/roles/packages/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- name: Install common packages (Debian) + when: ansible_os_family == "Debian" + become: yes + apt: name={{ item }} state=latest update_cache=yes + loop: + - curl + - tree + +- name: Install common packages (macOS) + when: ansible_os_family == "Darwin" + homebrew: name={{ item }} state=latest + loop: + - curl + - tree + diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index 520ddd5..c1eef8d 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -1,4 +1,13 @@ --- +- name: Install python3 (Debian) + when: ansible_os_family == "Debian" + become: yes + apt: name=python3 state=latest update_cache=yes + +- name: Install python3 (macOS) + when: ansible_os_family == "Darwin" + homebrew: name=python3 state=latest + - name: Create the python config and cache directories file: path: "~/.{{ item }}/python" diff --git a/roles/tmux/tasks/main.yml b/roles/tmux/tasks/main.yml index 92e3311..5409aaf 100644 --- a/roles/tmux/tasks/main.yml +++ b/roles/tmux/tasks/main.yml @@ -1,4 +1,13 @@ --- +- name: Install tmux (Debian) + when: ansible_os_family == "Debian" + become: yes + apt: name=tmux state=latest update_cache=yes + +- name: Install tmux (macOS) + when: ansible_os_family == "Darwin" + homebrew: name=tmux state=latest + - name: Create the tmux config directory file: path: ~/.config/tmux diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml index 255113a..1f4bf6c 100644 --- a/roles/vim/tasks/main.yml +++ b/roles/vim/tasks/main.yml @@ -1,4 +1,13 @@ --- +- name: Install vim (Debian) + when: ansible_os_family == "Debian" + become: yes + apt: name=vim state=latest update_cache=yes + +- name: Install vim (macOS) + when: ansible_os_family == "Darwin" + homebrew: name=vim state=latest + - name: Create the vim cache and config directories file: path: "{{ item }}"