Move install-prefs to Ansible
I never ended up moving to this installation system, did I?
This commit is contained in:
parent
fb5a885e3c
commit
16bb2362ad
9 changed files with 124 additions and 138 deletions
|
@ -0,0 +1,10 @@
|
|||
***************
|
||||
*** 6,11 ****
|
||||
--- 6,12 ----
|
||||
{
|
||||
include "us(basic)"
|
||||
include "level3(ralt_switch)"
|
||||
+ include "keypad(oss)"
|
||||
|
||||
name[Group1]= "US keyboard with french symbols - AltGr combination";
|
||||
|
|
@ -1,24 +1,9 @@
|
|||
# TODO For other distributions
|
||||
|
||||
- name: Set variables
|
||||
set_fact:
|
||||
arch_based: "{{ ansible_distribution == 'Archlinux' }}"
|
||||
# arch: "{{ ansible_lsb.id == 'Arch' }}"
|
||||
# manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}"
|
||||
# termux: "{{ ansible_distribution == 'OtherLinux' and ansible_python.executable == '/data/data/com.termux/files/usr/bin/python' }}"
|
||||
# debian_based: "{{ ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' }}"
|
||||
# debian: "{{ ansible_distribution == 'Debian' }}"
|
||||
# ubuntu: "{{ ansible_distribution == 'Ubuntu' }}"
|
||||
# Package are installed with --asdeps because they are needed
|
||||
|
||||
# Etckeeper
|
||||
|
||||
- name: Install etckeeper (Arch based)
|
||||
pacman:
|
||||
name: etckeeper
|
||||
state: present
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
- name: Check if etckeeper is initialized
|
||||
stat:
|
||||
path: /etc/.git
|
||||
|
@ -44,58 +29,6 @@
|
|||
value: "etckeeper@{{ inventory_hostname }}"
|
||||
become: yes
|
||||
|
||||
# Arch configuration
|
||||
|
||||
- name: Install ccache
|
||||
pacman:
|
||||
name: ccache
|
||||
state: present
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
- name: Enable makepkg ccache
|
||||
replace:
|
||||
path: /etc/makepkg.conf
|
||||
regexp: '^BUILDENV=(.+)!ccache(.+)$'
|
||||
replace: 'BUILDENV=\1ccache\2'
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
- name: Set makepkg MAKEFLAGS
|
||||
replace:
|
||||
path: /etc/makepkg.conf
|
||||
regexp: '^#? *MAKEFLAGS=(.+)-j[0-9]+(.+)$'
|
||||
replace: "MAKEFLAGS=\\1-j{{ j }}\\2"
|
||||
become: yes
|
||||
vars:
|
||||
j: "{{ [ansible_processor_nproc - 1, 1] | max | int }}"
|
||||
when: arch_based
|
||||
|
||||
- name: Enable makepkg color
|
||||
replace:
|
||||
path: /etc/makepkg.conf
|
||||
regexp: '^BUILDENV=(.+)!color(.+)$'
|
||||
replace: 'BUILDENV=\1color\2'
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
- name: Enable pacman colors
|
||||
lineinfile:
|
||||
path: /etc/pacman.conf
|
||||
regexp: "^#?Color"
|
||||
line: "Color"
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
- name: Enable pacman pacman
|
||||
lineinfile:
|
||||
path: /etc/pacman.conf
|
||||
regexp: "^#?ILoveCandy"
|
||||
line: "ILoveCandy"
|
||||
insertafter: "^#?Color"
|
||||
become: yes
|
||||
when: arch_based
|
||||
|
||||
# Manjaro configuration
|
||||
|
||||
- name: Remove Manjaro's pamac
|
||||
|
@ -131,6 +64,15 @@
|
|||
notify: etc changed
|
||||
loop: "{{ xorg_common_config_dirs }}"
|
||||
|
||||
- name: Use Alt keys for numpad
|
||||
patch:
|
||||
src: us_qwert_alt_numpad.patch
|
||||
dest: /usr/share/X11/xkb/symbols/us_qwerty-fr
|
||||
become: yes
|
||||
when: display_server == 'x11'
|
||||
# This is not very nice but it's updated so infrequently that it's not worth
|
||||
# the trouble
|
||||
|
||||
- name: Check if there is Intel backlight
|
||||
stat:
|
||||
path: /sys/class/backlight/intel_backlight
|
||||
|
@ -144,6 +86,7 @@
|
|||
state: present
|
||||
become: yes
|
||||
when: display_server == 'x11' and intel_backlight.stat.exists and arch_based
|
||||
# TODO With software role? Would permit other distributions
|
||||
|
||||
- name: Configure Xorg Intel backlight
|
||||
copy:
|
||||
|
@ -196,13 +139,6 @@
|
|||
|
||||
# TLP configuration
|
||||
|
||||
- name: Install TLP (Arch based)
|
||||
pacman:
|
||||
name: tlp
|
||||
state: present
|
||||
when: arch_based
|
||||
become: yes
|
||||
|
||||
- name: Start/enable TLP
|
||||
systemd:
|
||||
name: tlp
|
||||
|
@ -213,13 +149,6 @@
|
|||
|
||||
# Network configuration
|
||||
|
||||
- name: Install dhcpcd (Arch based)
|
||||
pacman:
|
||||
name: dhcpcd
|
||||
state: present
|
||||
when: arch_based
|
||||
become: yes
|
||||
|
||||
- name: Start/enable dhcpcd
|
||||
systemd:
|
||||
name: dhcpcd
|
||||
|
@ -228,15 +157,6 @@
|
|||
become: yes
|
||||
notify: etc changed
|
||||
|
||||
- name: Install wpa_supplicant (Arch based)
|
||||
pacman:
|
||||
name: wpa_supplicant
|
||||
state: present
|
||||
when: arch_based
|
||||
become: yes
|
||||
notify:
|
||||
- wifi setup changed
|
||||
|
||||
- name: Configure wpa_supplicant
|
||||
template:
|
||||
src: wpa_supplicant.conf.j2
|
||||
|
@ -309,13 +229,6 @@
|
|||
notify: etc changed
|
||||
when: arch_based
|
||||
|
||||
- name: Install chrony
|
||||
pacman:
|
||||
name: chrony
|
||||
state: present
|
||||
when: arch_based
|
||||
become: yes
|
||||
|
||||
- name: Configure chrony
|
||||
copy:
|
||||
src: chrony.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue