Compare commits
5 Commits
moonlight
...
b733305a28
| Author | SHA1 | Date | |
|---|---|---|---|
| b733305a28 | |||
| baa0206937 | |||
| 2abc38f696 | |||
| 63ff47c3b2 | |||
| da4b8858d3 |
@@ -1,6 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
|
||||
roles:
|
||||
- role: sudo
|
||||
when: ansible_user_id != "root"
|
||||
@@ -15,6 +14,7 @@
|
||||
- role: bat
|
||||
- role: curl
|
||||
- role: fzf
|
||||
- role: gh
|
||||
- role: git
|
||||
- role: htop
|
||||
- role: jp
|
||||
@@ -28,7 +28,5 @@
|
||||
- role: nodejs
|
||||
- role: python
|
||||
|
||||
- role: 1password
|
||||
|
||||
- role: wsl
|
||||
when: '"WSL" in ansible_kernel'
|
||||
6
UnixGUI.yaml
Normal file
6
UnixGUI.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- import_playbook: UnixCLI.yaml
|
||||
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: 1password
|
||||
@@ -14,8 +14,9 @@
|
||||
- role: bat
|
||||
- role: curl
|
||||
- role: fzf
|
||||
- role: tree
|
||||
- role: gh
|
||||
- role: jq
|
||||
- role: tree
|
||||
- role: yq
|
||||
|
||||
- role: llvm
|
||||
|
||||
5
roles/gh/tasks/Darwin.yaml
Normal file
5
roles/gh/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
name: gh
|
||||
state: latest
|
||||
31
roles/gh/tasks/Debian.yaml
Normal file
31
roles/gh/tasks/Debian.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- set_fact:
|
||||
arch_map:
|
||||
aarch64: arm64
|
||||
armv6l: armhf
|
||||
armv7l: armhf
|
||||
i386: i386
|
||||
x86_64: amd64
|
||||
- set_fact:
|
||||
arch: '{{ [ansible_architecture] | map("extract", arch_map) | first }}'
|
||||
|
||||
- name: download apt repository key
|
||||
become: true
|
||||
get_url:
|
||||
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
|
||||
dest: /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||
mode: 0644
|
||||
|
||||
- name: add apt repository list
|
||||
become: true
|
||||
apt_repository:
|
||||
filename: github-cli
|
||||
repo: 'deb [arch={{arch}} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main'
|
||||
state: present
|
||||
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: gh
|
||||
state: latest
|
||||
update_cache: true
|
||||
5
roles/gh/tasks/Windows.yaml
Normal file
5
roles/gh/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: gh
|
||||
state: latest
|
||||
2
roles/gh/tasks/main.yaml
Normal file
2
roles/gh/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
@@ -14,7 +14,7 @@
|
||||
- name: check if already installed
|
||||
stat:
|
||||
path: '{{jp_exe}}'
|
||||
register: jp_exe
|
||||
register: jp_stat
|
||||
|
||||
- name: get installed version
|
||||
when: jp_stat.stat.exists == True
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
- assert:
|
||||
that: ansible_user_id != "root"
|
||||
|
||||
- include_vars: '{{ansible_os_family}}.yaml'
|
||||
|
||||
- name: create /etc/sudoers.d/{user} config file
|
||||
become: true
|
||||
template:
|
||||
src: sudoers
|
||||
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
||||
owner: root
|
||||
group: root
|
||||
owner: '{{sudo_owner}}'
|
||||
group: '{{sudo_group}}'
|
||||
mode: '0440'
|
||||
|
||||
3
roles/sudo/vars/Darwin.yaml
Normal file
3
roles/sudo/vars/Darwin.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_owner: root
|
||||
sudo_group: wheel
|
||||
3
roles/sudo/vars/Debian.yaml
Normal file
3
roles/sudo/vars/Debian.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_owner: root
|
||||
sudo_group: root
|
||||
@@ -3,6 +3,21 @@
|
||||
pacman:
|
||||
name:
|
||||
- tmux
|
||||
- xclip
|
||||
- urlscan
|
||||
state: latest
|
||||
|
||||
- name: install pacman package
|
||||
when: '"WSL" not in ansible_kernel'
|
||||
become: true
|
||||
pacman:
|
||||
name: xsel
|
||||
state: latest
|
||||
|
||||
- name: remove pacman package
|
||||
when: '"WSL" in ansible_kernel'
|
||||
become: true
|
||||
pacman:
|
||||
name:
|
||||
- xclip
|
||||
- xsel
|
||||
state: absent
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
---
|
||||
- name: install apt packages
|
||||
become: true
|
||||
package:
|
||||
apt:
|
||||
name:
|
||||
- tmux
|
||||
- gawk
|
||||
- jq
|
||||
- sysstat
|
||||
- urlview
|
||||
- xclip
|
||||
state: latest
|
||||
|
||||
- name: install apt package
|
||||
when: '"WSL" not in ansible_kernel'
|
||||
become: true
|
||||
apt:
|
||||
name: xsel
|
||||
state: latest
|
||||
|
||||
- name: remove apt package
|
||||
when: '"WSL" in ansible_kernel'
|
||||
become: true
|
||||
apt:
|
||||
name:
|
||||
- xclip
|
||||
- xsel
|
||||
state: absent
|
||||
|
||||
@@ -3,8 +3,22 @@
|
||||
dnf:
|
||||
name:
|
||||
- tmux
|
||||
- xclip
|
||||
- urlscan
|
||||
- sysstat
|
||||
- jq
|
||||
state: latest
|
||||
|
||||
- name: install dnf package
|
||||
when: '"WSL" not in ansible_kernel'
|
||||
become: true
|
||||
dnf:
|
||||
name: xsel
|
||||
state: latest
|
||||
|
||||
- name: remove dnf package
|
||||
when: '"WSL" in ansible_kernel'
|
||||
become: true
|
||||
dnf:
|
||||
name:
|
||||
- xclip
|
||||
- xsel
|
||||
state: absent
|
||||
|
||||
Reference in New Issue
Block a user