Ubuntu
This commit is contained in:
parent
8a58c3eeee
commit
ea78a81dc1
5 changed files with 126 additions and 18 deletions
|
@ -1,19 +1,23 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
PATH="$PATH:$HOME/.local/bin"
|
||||
|
||||
if [[ `uname` == "Linux" ]]; then
|
||||
if [[ -f /etc/pacman.conf ]]; then
|
||||
ansible-playbook -i inventory arch.yml
|
||||
elif [[ -f /etc/lsb-release ]]; then
|
||||
ansible-playbook -i inventory ubuntu.yml
|
||||
elif [[ -f /etc/fedora-release ]]; then
|
||||
ansible-playbook -i inventory fedora.yml
|
||||
else
|
||||
echo "can't autodetermine distro, just running default inventory"
|
||||
ansible-playbook -i inventory common.yml
|
||||
fi
|
||||
else
|
||||
ansible-playbook -i inventory osx.yml
|
||||
if [[ $(command -v ansible) ]]; then
|
||||
printf "ansible already installed"
|
||||
elif [[ $(uname) == "Linux" ]]; then
|
||||
if [[ $(command -v pacman) ]]; then
|
||||
sudo pacman -Sy ansible
|
||||
elif [[ $(command -v apt) ]]; then
|
||||
sudo apt install -y ansible python3-apt
|
||||
# ubuntu doesn't create a /usr/bin/python, so we have to make one ourselves
|
||||
ln -s /usr/bin/python3 /usr/bin/python
|
||||
elif [[ $(command -v dnf) ]]; then
|
||||
sudo dnf install ansible -y
|
||||
fi
|
||||
elif [[ $(uname) == "Darwin" ]]; then
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
/usr/local/bin/brew install ansible
|
||||
fi
|
||||
|
||||
ansible-playbook -i inventory main.yml
|
||||
|
|
|
@ -30,3 +30,25 @@
|
|||
vars:
|
||||
- dev_machine: "{{ _dev_machine }}"
|
||||
- rust_extras: "{{ _rust_extras }}"
|
||||
|
||||
- hosts: os_Archlinux
|
||||
gather_facts: True
|
||||
roles:
|
||||
- role: arch
|
||||
vars:
|
||||
dev_machine: "{{ _dev_machine }}"
|
||||
- role: common
|
||||
vars:
|
||||
- dev_machine: "{{ _dev_machine }}"
|
||||
- rust_extras: "{{ _rust_extras }}"
|
||||
|
||||
- hosts: os_Ubuntu
|
||||
gather_facts: False
|
||||
roles:
|
||||
- role: ubuntu
|
||||
vars:
|
||||
dev_machine: "{{ _dev_machine }}"
|
||||
- role: common
|
||||
vars:
|
||||
- dev_machine: "{{ _dev_machine }}"
|
||||
- rust_extras: "{{ _rust_extras }}"
|
||||
|
|
|
@ -1 +1,58 @@
|
|||
---
|
||||
- name: Update Packages
|
||||
become: yes
|
||||
become_method: sudo
|
||||
pacman:
|
||||
update_cache: yes
|
||||
upgrade: yes
|
||||
|
||||
- name: Install basics
|
||||
become: yes
|
||||
become_method: sudo
|
||||
pacman:
|
||||
name:
|
||||
- zsh
|
||||
- git
|
||||
- cmake
|
||||
- tmux
|
||||
- gnupg
|
||||
- neovim
|
||||
state: latest
|
||||
|
||||
- name: Install Development Tools
|
||||
when:
|
||||
- dev_machine == true
|
||||
become: yes
|
||||
become_method: sudo
|
||||
pacman:
|
||||
name:
|
||||
- base-devel
|
||||
- openssl
|
||||
state: latest
|
||||
|
||||
- name: clone yay from github
|
||||
when:
|
||||
- dev_machine == true
|
||||
become: false
|
||||
git:
|
||||
repo: https://aur.archlinux.org/yay.git
|
||||
dest: /tmp/yay
|
||||
version: master
|
||||
update: yes
|
||||
# notify: makepkg -si
|
||||
|
||||
- name: makepkg --noconfirm -si
|
||||
when:
|
||||
- dev_machine == true
|
||||
become: false
|
||||
command: makepkg --noconfirm -si
|
||||
args:
|
||||
chdir: /tmp/yay
|
||||
creates: /usr/bin/yay
|
||||
|
||||
- name: Install hstr
|
||||
when:
|
||||
- dev_machine == true
|
||||
command: yay -Sy --noconfirm --needed --cleanafter hstr
|
||||
args:
|
||||
creates: /usr/local/bin/hstr
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
- tmux
|
||||
- gpg
|
||||
- neovim
|
||||
- hstr
|
||||
state: latest
|
||||
|
||||
- name: Install @development-tools
|
||||
|
|
|
@ -2,20 +2,44 @@
|
|||
become: yes
|
||||
become_method: sudo
|
||||
apt:
|
||||
force_apt_get: yes
|
||||
name: "*"
|
||||
state: latest
|
||||
|
||||
- name: Install neovim
|
||||
- name: Install essentials
|
||||
become: yes
|
||||
become_method: sudo
|
||||
apt:
|
||||
name: "neovim"
|
||||
force_apt_get: yes
|
||||
name:
|
||||
- neovim
|
||||
- git
|
||||
- zsh
|
||||
- tmux
|
||||
- gpg
|
||||
- software-properties-common
|
||||
state: latest
|
||||
|
||||
- name: Install build-essential
|
||||
- name: Install Development Tools
|
||||
become: yes
|
||||
become_method: sudo
|
||||
apt:
|
||||
name: "build-essential"
|
||||
force_apt_get: yes
|
||||
name:
|
||||
- build-essential
|
||||
- cmake
|
||||
state: latest
|
||||
|
||||
# - name: Add hstr repo
|
||||
# become: yes
|
||||
# become_method: sudo
|
||||
# command: "add-apt-repository ppa:acicchetti/utils"
|
||||
|
||||
# - name: Install hstr
|
||||
# become: yes
|
||||
# become_method: sudo
|
||||
# apt:
|
||||
# force_apt_get: yes
|
||||
# name: hstr
|
||||
# state: latest
|
||||
# update_cache: yes
|
||||
|
|
Loading…
Add table
Reference in a new issue