From 1a6154f4115706a4a828de34280d0bbc02a4d344 Mon Sep 17 00:00:00 2001 From: Oleg Vasilev Date: Wed, 26 Jan 2022 00:39:23 +0300 Subject: [PATCH] Just copy common-2 here --- handlers/main.yml | 4 +++ tasks/main.yml | 13 ++++++++ tasks/packages.yml | 32 ++++++++++++++++++ tasks/pacman.yml | 17 ++++++++++ tasks/system.yml | 23 +++++++++++++ templates/locale.conf.j2 | 2 ++ templates/locale.gen.j2 | 4 +++ templates/mirrorlist.j2 | 4 +++ templates/pacman.conf.j2 | 66 +++++++++++++++++++++++++++++++++++++ templates/timesyncd.conf.j2 | 5 +++ 10 files changed, 170 insertions(+) create mode 100644 handlers/main.yml create mode 100644 tasks/main.yml create mode 100644 tasks/packages.yml create mode 100644 tasks/pacman.yml create mode 100644 tasks/system.yml create mode 100644 templates/locale.conf.j2 create mode 100644 templates/locale.gen.j2 create mode 100644 templates/mirrorlist.j2 create mode 100644 templates/pacman.conf.j2 create mode 100644 templates/timesyncd.conf.j2 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..9068731 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,4 @@ +--- + +- name: System | Generate locales + shell: locale-gen diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..8f6fa73 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,13 @@ +--- + +- name: Common | Configure system + import_tasks: system.yml + +- name: Common | Configure pacman + import_tasks: pacman.yml + +- name: Common | Packages + import_tasks: packages.yml + +- name: Common | Run handlers + meta: flush_handlers diff --git a/tasks/packages.yml b/tasks/packages.yml new file mode 100644 index 0000000..0ccbbe6 --- /dev/null +++ b/tasks/packages.yml @@ -0,0 +1,32 @@ +--- + +- name: Packages | Install useful packages + pacman: + state: present + update_cache: yes + name: + - htop + - nano + - strace + - lsof + - wget + - curl + - go + - tcpdump + - nmap + - dosfstools + - arch-install-scripts + - gptfdisk + - bash-completion + - git + +#- block: +# - name: Packages | Install yay from aur +# aur: +# name: yay +# use: makepkg +# skip_installed: yes + +# become: no + + diff --git a/tasks/pacman.yml b/tasks/pacman.yml new file mode 100644 index 0000000..e6a9d8b --- /dev/null +++ b/tasks/pacman.yml @@ -0,0 +1,17 @@ +--- + +- name: Deploy pacman main config + template: + src: pacman.conf.j2 + dest: /etc/pacman.conf + mode: 0644 + owner: root + group: root + +- name: Setup pacman repos + template: + src: mirrorlist.j2 + dest: /etc/pacman.d/mirrorlist + mode: 0644 + owner: root + group: root diff --git a/tasks/system.yml b/tasks/system.yml new file mode 100644 index 0000000..126d37f --- /dev/null +++ b/tasks/system.yml @@ -0,0 +1,23 @@ +--- + +- name: System | Set or/and generate locales + template: + src: locale.gen.j2 + dest: /etc/locale.gen + mode: 0644 + owner: root + group: root + notify: System | Generate locales + +- name: System | Set system locale + template: + src: locale.conf.j2 + mode: 0644 + owner: root + group: root + dest: /etc/locale.conf + +- name: System | Set timezone + timezone: + name: Europe/Moscow + diff --git a/templates/locale.conf.j2 b/templates/locale.conf.j2 new file mode 100644 index 0000000..4ea5693 --- /dev/null +++ b/templates/locale.conf.j2 @@ -0,0 +1,2 @@ +# {{ ansible_managed }} +LANG={{ use_system_locale }} diff --git a/templates/locale.gen.j2 b/templates/locale.gen.j2 new file mode 100644 index 0000000..3a8ef67 --- /dev/null +++ b/templates/locale.gen.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +{% for item in system_locales | default([]) %} +{{ item }} +{% endfor %} diff --git a/templates/mirrorlist.j2 b/templates/mirrorlist.j2 new file mode 100644 index 0000000..508d969 --- /dev/null +++ b/templates/mirrorlist.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +Server = http://mirror.zeym.org/archlinux/$repo/os/$arch +Server = http://mirror.yandex.ru/archlinux/$repo/os/$arch + diff --git a/templates/pacman.conf.j2 b/templates/pacman.conf.j2 new file mode 100644 index 0000000..1fc8588 --- /dev/null +++ b/templates/pacman.conf.j2 @@ -0,0 +1,66 @@ +# {{ ansible_managed}} +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -C - -f %u > %o +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +#UseDelta = 0.7 +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +Color +#TotalDownload +CheckSpace +VerbosePkgLists + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +RemoteFileSigLevel = Required + +#[testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +#[community-testing] +#Include = /etc/pacman.d/mirrorlist + +[community] +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. +[multilib] +Include = /etc/pacman.d/mirrorlist + +#[multilib-testing] +#Include = /etc/pacman.d/mirrorlist + + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/templates/timesyncd.conf.j2 b/templates/timesyncd.conf.j2 new file mode 100644 index 0000000..a702227 --- /dev/null +++ b/templates/timesyncd.conf.j2 @@ -0,0 +1,5 @@ +# {{ ansible_managed }} +[Time] +NTP=pool.ntp.org +FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org +RootDistanceMaxSec=10