1
0
Fork 0
dotfiles2000/system/arch/baseconfig.yaml

137 lines
3.2 KiB
YAML
Raw Normal View History

2024-10-31 22:09:39 +01:00
- name: "Base config for all arch hosts"
hosts: localhost
connection: local
tasks:
2024-11-05 21:05:54 +01:00
- name: "Update pacman cache"
community.general.pacman:
update_cache: True
2024-10-31 22:09:39 +01:00
- name: "Install base packages"
2024-11-05 21:05:54 +01:00
ansible.builtin.package:
name: '{{ item }}'
2024-10-31 22:09:39 +01:00
state: present
2024-11-05 21:05:54 +01:00
update_cache: False
with_items:
- fortune-mod
- git
- make
- openssh
- pass
- pass-otp
- rsync
- sudo
- vim
2024-10-31 22:09:39 +01:00
- name: "Remove unwanted packages"
2024-11-05 21:05:54 +01:00
ansible.builtin.package:
2024-10-31 22:09:39 +01:00
name:
- puppet
state: absent
update_cache: false
- name: "Console settings"
when: "'gpd' not in ansible_hostname"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/vconsole.conf
owner: root
group: root
mode: 0644
content: |
KEYMAP=de-latin1-nodeadkeys
- name: "Localization: Set papersize"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/papersize
owner: root
group: root
mode: 0644
content: |
a4
- name: "Localization: Set timezone"
2024-11-05 21:05:54 +01:00
ansible.builtin.file:
2024-10-31 22:09:39 +01:00
dest: /etc/localtime
src: /usr/share/zoneinfo/Europe/Berlin
state: link
- name: "Localization: locale.conf"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/locale.conf"
owner: root
group: root
mode: 0644
content: |
##### THIS IS MANAGED BY ANSIBLE #####
LANG=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_COLLATE=C
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
- name: "Localization: locale.gen"
register: locale_gen
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/locale.gen
owner: root
group: root
mode: 0644
content: |
##### THIS IS MANAGED BY ANSIBLE #####
de_DE.UTF-8 UTF-8
en_US.UTF-8 UTF-8
- name: "Localization: Regenerate locale"
when: locale_gen.changed
2024-11-05 21:05:54 +01:00
ansible.builtin.command: "/usr/bin/locale-gen"
2024-10-31 22:09:39 +01:00
- name: "Use systemd-timesyncd"
2024-11-05 21:05:54 +01:00
ansible.builtin.service:
2024-10-31 22:09:39 +01:00
name: systemd-timesyncd
state: started
enabled: yes
- name: "Sudo: config file"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/sudoers
src: ./lib/etc/sudoers
owner: root
group: root
mode: 0440
- name: "Sudo: Create groups"
2024-11-05 21:05:54 +01:00
ansible.builtin.group:
2024-10-31 22:09:39 +01:00
name: '{{ item }}'
state: present
system: true
with_items:
- wheel
- sudo
- name: "Pacman configuration"
when: "'arm' not in ansible_machine"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/pacman.conf
src: ./lib/etc/pacman.conf
owner: root
group: root
mode: 0644
- name: "Pacman configuration (ARM)"
when: "'arm' in ansible_machine"
2024-11-05 21:05:54 +01:00
ansible.builtin.copy:
2024-10-31 22:09:39 +01:00
dest: /etc/pacman.conf
src: ./lib/etc/pacman.conf.arm
owner: root
group: root
mode: 0644