From b69934072ff1343d1dcbce50911b58db98601623 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 27 Oct 2022 00:12:06 -0400 Subject: [PATCH] Move what can be shared in the base role out to the common tasks file. --- ansible/roles/base/files/gitconfig_home | 2 ++ ansible/roles/base/files/ignore | 2 ++ ansible/roles/base/tasks/common.yaml | 35 +++++++++++++++++++++++++ ansible/roles/base/tasks/freebsd.yaml | 30 --------------------- ansible/roles/base/tasks/linux.yaml | 5 ++++ 5 files changed, 44 insertions(+), 30 deletions(-) diff --git a/ansible/roles/base/files/gitconfig_home b/ansible/roles/base/files/gitconfig_home index 5bcd33f..8e4b8dd 100644 --- a/ansible/roles/base/files/gitconfig_home +++ b/ansible/roles/base/files/gitconfig_home @@ -13,3 +13,5 @@ gpgsign = true [pull] rebase = true +[log] + date = local diff --git a/ansible/roles/base/files/ignore b/ansible/roles/base/files/ignore index e69de29..8f3a70f 100644 --- a/ansible/roles/base/files/ignore +++ b/ansible/roles/base/files/ignore @@ -0,0 +1,2 @@ +**/backend/test_data +**/backend/notebooks diff --git a/ansible/roles/base/tasks/common.yaml b/ansible/roles/base/tasks/common.yaml index d7c1735..f00fdd2 100644 --- a/ansible/roles/base/tasks/common.yaml +++ b/ansible/roles/base/tasks/common.yaml @@ -1,3 +1,38 @@ +- name: Install packages + package: + name: + - rsync + - bash + - tmux + - lsof + - mg + - htop + - tree + - curl + - ncdu + - ripgrep + - git-crypt + state: present + +- name: Set timezone + file: + src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}" + dest: /etc/localtime + owner: root + group: wheel + state: link + +- name: Install scripts + copy: + src: "files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: 0755 + owner: root + group: wheel + loop: + - src: git_branches_by_owner_time + dest: /usr/local/bin/git_branches_by_owner_time + - import_tasks: tasks/freebsd.yaml when: 'os_flavor == "freebsd"' diff --git a/ansible/roles/base/tasks/freebsd.yaml b/ansible/roles/base/tasks/freebsd.yaml index 371211e..88a6e65 100644 --- a/ansible/roles/base/tasks/freebsd.yaml +++ b/ansible/roles/base/tasks/freebsd.yaml @@ -1,18 +1,7 @@ - name: Install packages package: name: - - rsync - - bash - - tmux - - lsof - - mg - - htop - - tree - - curl - pstree - - ncdu - - ripgrep - - git-crypt state: present - name: See if the alacritty termcap has been added @@ -104,22 +93,3 @@ src: tmpfs fstype: tmpfs opts: rw,mode=777 - -- name: Set timezone - file: - src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}" - dest: /etc/localtime - owner: root - group: wheel - state: link - -- name: Install scripts - copy: - src: "files/{{ item.src }}" - dest: "{{ item.dest }}" - mode: 0755 - owner: root - group: wheel - loop: - - src: git_branches_by_owner_time - dest: /usr/local/bin/git_branches_by_owner_time diff --git a/ansible/roles/base/tasks/linux.yaml b/ansible/roles/base/tasks/linux.yaml index e69de29..87a5ea1 100644 --- a/ansible/roles/base/tasks/linux.yaml +++ b/ansible/roles/base/tasks/linux.yaml @@ -0,0 +1,5 @@ +- name: Install packages + package: + name: + - psmisc + state: present