Major role refactoring
This commit is contained in:
		@@ -1,9 +1,11 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
system_locales:
 | 
					# https://sourceware.org/glibc/wiki/Locales
 | 
				
			||||||
  - "{{ system_locale_lang }}"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
system_locale_lang: en_US.UTF-8
 | 
					system_locales:
 | 
				
			||||||
 | 
					  - en_US.UTF-8 UTF-8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					system_locale_lang: "{{ (system_locales | first). split(' ')[0] }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
system_locale_ctype: "{{ system_locale_lang }}"
 | 
					system_locale_ctype: "{{ system_locale_lang }}"
 | 
				
			||||||
system_locale_numeric: "{{ system_locale_lang }}"
 | 
					system_locale_numeric: "{{ system_locale_lang }}"
 | 
				
			||||||
							
								
								
									
										18
									
								
								defaults/packages.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								defaults/packages.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					common_packages:
 | 
				
			||||||
 | 
					  - htop
 | 
				
			||||||
 | 
					  - nano
 | 
				
			||||||
 | 
					  - strace
 | 
				
			||||||
 | 
					  - lsof
 | 
				
			||||||
 | 
					  - wget
 | 
				
			||||||
 | 
					  - curl
 | 
				
			||||||
 | 
					  - go
 | 
				
			||||||
 | 
					  - tcpdump
 | 
				
			||||||
 | 
					  - nmap
 | 
				
			||||||
 | 
					  - dosfstools
 | 
				
			||||||
 | 
					  - arch-install-scripts
 | 
				
			||||||
 | 
					  - gptfdisk
 | 
				
			||||||
 | 
					  - bash-completion
 | 
				
			||||||
 | 
					  - git
 | 
				
			||||||
 | 
					  - bind
 | 
				
			||||||
							
								
								
									
										10
									
								
								defaults/pacman.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								defaults/pacman.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pacman_mirrors:
 | 
				
			||||||
 | 
					  - https://mirrors.kernel.org/archlinux/$repo/os/$arch
 | 
				
			||||||
 | 
					  - https://mirror.surf/archlinux/$repo/os/$arch
 | 
				
			||||||
 | 
					  - https://mirror.yandex.ru/archlinux/$repo/os/$arch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pacman_ignorepkg: []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pacman_parallel_downloads: 2
 | 
				
			||||||
							
								
								
									
										3
									
								
								defaults/timezone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								defaults/timezone.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					common_timezone: "Europe/Moscow"
 | 
				
			||||||
@@ -1,13 +1,49 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Common | Configure system
 | 
					- name: Common | Set available locales
 | 
				
			||||||
  import_tasks: system.yml
 | 
					  template:
 | 
				
			||||||
 | 
					    src: locale.gen.j2
 | 
				
			||||||
- name: Common | Configure pacman
 | 
					    dest: /etc/locale.gen
 | 
				
			||||||
  import_tasks: pacman.yml
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
- name: Common | Packages
 | 
					    group: root
 | 
				
			||||||
  import_tasks: packages.yml
 | 
					  notify: Common | Generate locales
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Common | Run handlers
 | 
					- name: Common | Run handlers
 | 
				
			||||||
  meta: flush_handlers
 | 
					  meta: flush_handlers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Common | Set system locale
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: locale.conf.j2
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					    dest: /etc/locale.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Common | Set timezone
 | 
				
			||||||
 | 
					  timezone:
 | 
				
			||||||
 | 
					    name: "{{ common_timezone }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Common | Deploy pacman main config
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: pacman.conf.j2
 | 
				
			||||||
 | 
					    dest: /etc/pacman.conf
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Common | Setup pacman repos
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: mirrorlist.j2
 | 
				
			||||||
 | 
					    dest: /etc/pacman.d/mirrorlist
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Common | Install useful common packages
 | 
				
			||||||
 | 
					  pacman:
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					    update_cache: yes
 | 
				
			||||||
 | 
					    name: "{{ common_packages }}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,34 +0,0 @@
 | 
				
			|||||||
---
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Install useful packages
 | 
					 | 
				
			||||||
  pacman:
 | 
					 | 
				
			||||||
    state: present
 | 
					 | 
				
			||||||
    update_cache: yes
 | 
					 | 
				
			||||||
# Move this to vars and add additional variable for custom packages
 | 
					 | 
				
			||||||
    name:
 | 
					 | 
				
			||||||
      - htop
 | 
					 | 
				
			||||||
      - nano
 | 
					 | 
				
			||||||
      - strace
 | 
					 | 
				
			||||||
      - lsof
 | 
					 | 
				
			||||||
      - wget
 | 
					 | 
				
			||||||
      - curl
 | 
					 | 
				
			||||||
      - go
 | 
					 | 
				
			||||||
      - tcpdump
 | 
					 | 
				
			||||||
      - nmap
 | 
					 | 
				
			||||||
      - dosfstools
 | 
					 | 
				
			||||||
      - arch-install-scripts
 | 
					 | 
				
			||||||
      - gptfdisk
 | 
					 | 
				
			||||||
      - bash-completion
 | 
					 | 
				
			||||||
      - git
 | 
					 | 
				
			||||||
      - bind
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#- block:
 | 
					 | 
				
			||||||
#  - name: Common | Install yay from aur
 | 
					 | 
				
			||||||
#    aur:
 | 
					 | 
				
			||||||
#      name: yay
 | 
					 | 
				
			||||||
#      use: makepkg
 | 
					 | 
				
			||||||
#      skip_installed: yes
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#  become: no
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,17 +0,0 @@
 | 
				
			|||||||
---
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Deploy pacman main config
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: pacman.conf.j2
 | 
					 | 
				
			||||||
    dest: /etc/pacman.conf
 | 
					 | 
				
			||||||
    mode: 0644
 | 
					 | 
				
			||||||
    owner: root
 | 
					 | 
				
			||||||
    group: root
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Setup pacman repos
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: mirrorlist.j2
 | 
					 | 
				
			||||||
    dest: /etc/pacman.d/mirrorlist
 | 
					 | 
				
			||||||
    mode: 0644
 | 
					 | 
				
			||||||
    owner: root
 | 
					 | 
				
			||||||
    group: root
 | 
					 | 
				
			||||||
@@ -1,23 +0,0 @@
 | 
				
			|||||||
---
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Set or/and generate locales
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: locale.gen.j2
 | 
					 | 
				
			||||||
    dest: /etc/locale.gen
 | 
					 | 
				
			||||||
    mode: 0644
 | 
					 | 
				
			||||||
    owner: root
 | 
					 | 
				
			||||||
    group: root
 | 
					 | 
				
			||||||
  notify: Common | Generate locales
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Set system locale
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: locale.conf.j2
 | 
					 | 
				
			||||||
    mode: 0644
 | 
					 | 
				
			||||||
    owner: root
 | 
					 | 
				
			||||||
    group: root
 | 
					 | 
				
			||||||
    dest: /etc/locale.conf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Common | Set timezone
 | 
					 | 
				
			||||||
  timezone:
 | 
					 | 
				
			||||||
    name: Europe/Moscow
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
# {{ ansible_managed }}
 | 
					# {{ ansible_managed }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LANG="{{ system_locale_lang }}"
 | 
					LANG="{{ system_locale_lang }}"
 | 
				
			||||||
LC_CTYPE="{{ system_locale_ctype }}"
 | 
					LC_CTYPE="{{ system_locale_ctype }}"
 | 
				
			||||||
LC_NUMERIC="{{ system_locale_numeric }}"
 | 
					LC_NUMERIC="{{ system_locale_numeric }}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
# {{ ansible_managed }}
 | 
					# {{ ansible_managed }}
 | 
				
			||||||
{% for item in system_locales %}
 | 
					
 | 
				
			||||||
{{ item }}
 | 
					{% for locale in system_locales %}
 | 
				
			||||||
 | 
					{{ locale }}
 | 
				
			||||||
{% endfor %}
 | 
					{% endfor %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
# {{ ansible_managed }}
 | 
					# {{ ansible_managed }}
 | 
				
			||||||
Server = http://mirror.zeym.org/archlinux/$repo/os/$arch
 | 
					 | 
				
			||||||
Server = http://mirror.yandex.ru/archlinux/$repo/os/$arch
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% for server in pacman_mirrors %}
 | 
				
			||||||
 | 
					Server = {{ server }}
 | 
				
			||||||
 | 
					{% endfor %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
# {{ ansible_managed}}
 | 
					# {{ ansible_managed}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[options]
 | 
					[options]
 | 
				
			||||||
# The following paths are commented out with their default values listed.
 | 
					# The following paths are commented out with their default values listed.
 | 
				
			||||||
# If you wish to use different paths, uncomment and update the paths.
 | 
					# If you wish to use different paths, uncomment and update the paths.
 | 
				
			||||||
@@ -16,7 +17,7 @@ HoldPkg     = pacman glibc
 | 
				
			|||||||
Architecture = auto
 | 
					Architecture = auto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
 | 
					# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
 | 
				
			||||||
#IgnorePkg   =
 | 
					IgnorePkg   = {{ pacman_ignorepkg | join(' ') }}
 | 
				
			||||||
#IgnoreGroup =
 | 
					#IgnoreGroup =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#NoUpgrade   =
 | 
					#NoUpgrade   =
 | 
				
			||||||
@@ -25,9 +26,9 @@ Architecture = auto
 | 
				
			|||||||
# Misc options
 | 
					# Misc options
 | 
				
			||||||
#UseSyslog
 | 
					#UseSyslog
 | 
				
			||||||
Color
 | 
					Color
 | 
				
			||||||
#TotalDownload
 | 
					 | 
				
			||||||
CheckSpace
 | 
					CheckSpace
 | 
				
			||||||
VerbosePkgLists
 | 
					VerbosePkgLists
 | 
				
			||||||
 | 
					ParallelDownloads = {{ pacman_parallel_downloads }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# By default, pacman accepts packages signed by keys that its local keyring
 | 
					# 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.
 | 
					# trusts (see pacman-key and its man page), as well as unsigned packages.
 | 
				
			||||||
@@ -35,15 +36,15 @@ SigLevel    = Required DatabaseOptional
 | 
				
			|||||||
LocalFileSigLevel = Optional
 | 
					LocalFileSigLevel = Optional
 | 
				
			||||||
RemoteFileSigLevel = Required
 | 
					RemoteFileSigLevel = Required
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[testing]
 | 
					 | 
				
			||||||
#Include = /etc/pacman.d/mirrorlist
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[core]
 | 
					[core]
 | 
				
			||||||
Include = /etc/pacman.d/mirrorlist
 | 
					Include = /etc/pacman.d/mirrorlist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[extra]
 | 
					[extra]
 | 
				
			||||||
Include = /etc/pacman.d/mirrorlist
 | 
					Include = /etc/pacman.d/mirrorlist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#[testing]
 | 
				
			||||||
 | 
					#Include = /etc/pacman.d/mirrorlist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[community-testing]
 | 
					#[community-testing]
 | 
				
			||||||
#Include = /etc/pacman.d/mirrorlist
 | 
					#Include = /etc/pacman.d/mirrorlist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +0,0 @@
 | 
				
			|||||||
# {{ 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
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user