finalyse system

This commit is contained in:
vincent 2018-12-02 21:03:03 +01:00
parent e3f07b97b6
commit cfdaa4e30d
8 changed files with 69 additions and 4 deletions

View File

@ -1 +1,8 @@
username: user
username: user
arch_base_locale: fr_FR.UTF-8
arch_base_keymap: FR
arch_base_timezone: Europe/Paris
arch_base_locales: [
"fr_FR.UTF-8",
"en_US.UTF-8"
]

View File

@ -0,0 +1,11 @@
---
- name: Update hostname
hostname: name={{ arch_base_hostname }}
- name: Update keymap
command: localectl set-keymap {{ arch_base_keymap }}
- name: Update pacman repos
pacman: update_cache=yes
- name: Restart sshd
service: name=sshd state=restarted

View File

@ -1,7 +1,7 @@
- name: launch base install software
pacman:
state: present # not required. choices: absent;latest;present. Desired state of the package.
name: ['zsh','stow','awesome-terminal-fonts','wget','bat','diff-so-fancy','git','htop','thefuck','tldr','ntfs-3g','tmux','vim','zsh-theme-powerlevel9k' ] # not required. Name or list of names of the packages to install, upgrade, or remove.
name: ['zsh','stow','nmap','rsync','awesome-terminal-fonts','wget','bat','diff-so-fancy','git','htop','thefuck','tldr','ntfs-3g','tmux','vim','zsh-theme-powerlevel9k' ] # not required. Name or list of names of the packages to install, upgrade, or remove.
update_cache: true # not required. Whether or not to refresh the master package lists. This can be run as part of a package installation or as a separate step.
become: yes

4
tasks/hostname.yml Normal file
View File

@ -0,0 +1,4 @@
- name: Ensure hostname set
hostname: name={{ inventory_hostname }}

22
tasks/locales.yml Normal file
View File

@ -0,0 +1,22 @@
---
- name: Set keymap
copy: content="KEYMAP={{ arch_base_keymap }}\n" dest=/etc/vconsole.conf
notify: Update keymap
become: yes
- name: Generate locales
locale_gen:
name: "{{ item }}"
state: present
with_items: "{{ arch_base_locales }}"
become: yes
- name: Set locale
lineinfile: dest=/etc/locale.conf line="LANG={{ arch_base_locale }}" regexp="^LANG=" create=yes
become: yes
- name: Set timezone
become: yes
command: timedatectl set-timezone {{ arch_base_timezone }}
args:
creates: /etc/localtime

View File

@ -1,4 +1,7 @@
---
- include_tasks: hostname.yml
- include_tasks: locales.yml
- include_tasks: pacman.yml
- include_tasks: time.yml
- include_tasks: AUR_builder.yml
- include_tasks: base_software.yml
- include_tasks: user_config_file.yml
- include_tasks: base_software.yml

12
tasks/pacman.yml Normal file
View File

@ -0,0 +1,12 @@
---
- name: Configure pacman color
replace: dest=/etc/pacman.conf regexp="^#(Color)" replace="\1"
become: yes
- name: Configure more pacman visuals
replace: dest=/etc/pacman.conf regexp="#(VerbosePkgLists)" replace="\1\nILoveCandy"
become: yes
- name: Configure pacman multilib repo
become: yes
replace: dest=/etc/pacman.conf regexp="^#(\[multilib\])\n^#(.*)$" replace="\1\n\2"
when: ansible_architecture == "x86_64"
notify: Update pacman repos

6
tasks/time.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: Enable timesync
command: timedatectl set-ntp true
become: yes
args:
creates: /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service