Merge branch 'master' of git_opytex:/lafrite/Ansible_workstation

This commit is contained in:
Bertrand Benjamin 2020-02-06 08:27:54 +01:00
commit dfb03c9b19
18 changed files with 187 additions and 53 deletions

View File

@ -14,7 +14,7 @@
- include: tasks/sudo.yml - include: tasks/sudo.yml
- include: tasks/ssh.yml - include: tasks/ssh.yml
- include: tasks/dotfiles.yml - include: tasks/dotfiles.yml
- include: tasks/docker.yml - include: tasks/deb_docker.yml
handlers: handlers:
- name: restart sshd - name: restart sshd

View File

@ -12,9 +12,10 @@
# - include: tasks/test.yml # - include: tasks/test.yml
- include: tasks/ansible.yml - include: tasks/ansible.yml
- include: tasks/arch_aur.yml - include: tasks/arch_aur.yml
- include: tasks/pacman_cache_server.yml
- include: tasks/arch_CLI_packages.yml - include: tasks/arch_CLI_packages.yml
- include: tasks/prompt.yml - include: tasks/prompt.yml
- include: tasks/users.yml # - include: tasks/users.yml
- include: tasks/sudo.yml - include: tasks/sudo.yml
- include: tasks/ssh.yml - include: tasks/ssh.yml
- include: tasks/arch_programming.yml - include: tasks/arch_programming.yml
@ -35,7 +36,15 @@
service: service:
name: sshd name: sshd
state: restarted state: restarted
- name: restart nfs - name: restart nfs-server
service: service:
name: nfs-server name: nfs-server
state: restarted state: restarted
- name: restart nfs-client
service:
name: nfs-client
state: restarted
- name: restart autofs
service:
name: autofs
state: restarted

View File

@ -14,7 +14,7 @@
- include: tasks/arch_CLI_packages.yml - include: tasks/arch_CLI_packages.yml
- include: tasks/dd_backup.yml - include: tasks/dd_backup.yml
- include: tasks/prompt.yml - include: tasks/prompt.yml
- include: tasks/users.yml # - include: tasks/users.yml
- include: tasks/sudo.yml - include: tasks/sudo.yml
# - include: tasks/ssh.yml # - include: tasks/ssh.yml
- include: tasks/arch_programming.yml - include: tasks/arch_programming.yml

View File

@ -15,7 +15,7 @@
- include: tasks/sudo.yml - include: tasks/sudo.yml
- include: tasks/ssh.yml - include: tasks/ssh.yml
- include: tasks/dotfiles.yml - include: tasks/dotfiles.yml
- include: tasks/docker.yml - include: tasks/deb_docker.yml
handlers: handlers:
- name: restart sshd - name: restart sshd

View File

@ -5,6 +5,7 @@
vars_files: vars_files:
- vars/common.yml - vars/common.yml
- vars/home.yml - vars/home.yml
- vars/users.yml
- vars/Combava.yml - vars/Combava.yml
tasks: tasks:
@ -14,8 +15,8 @@
- include: tasks/arch_aur.yml - include: tasks/arch_aur.yml
#- include: tasks/dd_backup.yml #- include: tasks/dd_backup.yml
- include: tasks/prompt.yml - include: tasks/prompt.yml
- include: tasks/users.yml #- include: tasks/users.yml
# - include: tasks/ssh.yml - include: tasks/ssh.yml
- include: tasks/arch_programming.yml - include: tasks/arch_programming.yml
- include: tasks/arch_teacher.yml - include: tasks/arch_teacher.yml
- include: tasks/arch_gnome.yml - include: tasks/arch_gnome.yml
@ -24,6 +25,7 @@
- include: tasks/dotfiles_desktop.yml - include: tasks/dotfiles_desktop.yml
- include: tasks/home_autofs.yml - include: tasks/home_autofs.yml
- include: tasks/laptop.yml - include: tasks/laptop.yml
- include: tasks/arch_docker.yml
# - include: tasks/nfs_share.yml # - include: tasks/nfs_share.yml
# - include: tasks/wine.yml # - include: tasks/wine.yml
# - include: tasks/arch_virtualbox.yml # - include: tasks/arch_virtualbox.yml

View File

@ -16,22 +16,10 @@ Installing Choux
git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Choux.yml ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Choux.yml
Installing Songe Depuis peu, il y a un bug entre pacman et ansible:
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Songe.yml LC_ALL=C ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git --vault-id @prompt Choux.yml
Installing Bilimbi
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Bilimbi.yml
Installing Manioc
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Manioc.yml
After running the script, there is a bug with $TERM which makes BACKSPACE and TAB to have strange behavior. To solve it, from an other computer run:
infocmp -x | ssh -t root@remote-host 'cat > "$TERM.info" && tic -x "$TERM.info"'
## By hand for Choux ## By hand for Choux

View File

@ -28,15 +28,6 @@ Host github
PubkeyAcceptedKeyTypes * PubkeyAcceptedKeyTypes *
identityfile ~/.ssh/id_dsa_noPass identityfile ~/.ssh/id_dsa_noPass
Host Songe
HostName songe
User waha
Port 22
ForwardAgent yes
PubkeyAcceptedKeyTypes *
identityfile ~/.ssh/id_rsa_songe
IdentitiesOnly yes
Host Choux Host Choux
HostName Choux HostName Choux
User lafrite User lafrite

View File

@ -1,5 +1,5 @@
session_name: enseignement session_name: enseignement
start_directory: /media/documents/Cours/Prof/Enseignements/2019-2020/ start_directory: ~/Cours/Prof/Enseignements/2019-2020/
shell_command_before: source config.fish shell_command_before: source config.fish
windows: windows:

View File

@ -143,6 +143,7 @@ command! make !!make %a
command! mkcd :mkdir %a | cd %a command! mkcd :mkdir %a | cd %a
command! vgrep vim "+grep %a" command! vgrep vim "+grep %a"
command! reload :write | restart command! reload :write | restart
command ln ln -s %f:p %D
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------

51
files/nginx.conf Normal file
View File

@ -0,0 +1,51 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
# Use a custom log format that will show response times and cache status
log_format archmirror '$remote_addr - $upstream_cache_status [$time_local] $request_method $host$request_uri $server_protocol $status $body_bytes_sent $request_time $upstream_response_time';
# Configure the cache directory, size and keys
proxy_cache_path /srv/http/pacman-cache
levels=1:2 keys_zone=archmirror:60m
inactive=365d use_temp_path=off max_size=3g;
server {
listen 8080;
server_name cache.local;
access_log /var/log/nginx/archmirror.access.log archmirror;
error_log /var/log/nginx/archmirror.error.log;
# Force proxy to use TLS for upstream server requests
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# Use previously negotiated connection parameters
proxy_ssl_session_reuse on;
# Enables revalidation of expired cache items using conditional requests with the "If-Modified-Since" and "If-None-Match" header fields.
proxy_cache_revalidate on;
# Only one request at a time will be allowed to populate a new cache element
proxy_cache_lock on;
# Cache any responses for 1 minute by default, can be overridden by more specific response codes
proxy_cache_valid any 1m;
# Keep connections to upstream server open
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_read_timeout 300;
proxy_connect_timeout 300;
location / {
proxy_pass http://mirror.archlinux.ikoula.com;
proxy_cache archmirror; # This directive should match the keys_zone option
proxy_cache_valid 200 5m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
# Add some cache status headers for debugging purposes, you can remove these lines if you want
add_header X-Upstream-Status $upstream_status;
add_header X-Cache-Status $upstream_cache_status;
}
}
}

View File

@ -5,3 +5,8 @@
- docker - docker
state: present state: present
- name: Enable docker daemon
service:
name: docker
state: started
enabled: yes

View File

@ -31,6 +31,7 @@
enabled: no enabled: no
with_items: with_items:
- dhcpcd - dhcpcd
ignore_errors: yes
- name: enable service NetworkManager - name: enable service NetworkManager
systemd: systemd:
@ -61,12 +62,73 @@
use: makepkg use: makepkg
skip_installed: true skip_installed: true
with_items: with_items:
- plata-theme
- gnome-colors-icon-theme - gnome-colors-icon-theme
- ubo-icons
- shadow-icon-theme
- vertex-themes
- vertex-icons-git
- numix-icon-theme-git - numix-icon-theme-git
- numix-circle-icon-theme-git - numix-circle-icon-theme-git
- tela-icon-theme-git
become: yes become: yes
become_user: aur_builder become_user: aur_builder
- name: <super + q> to close window
dconf:
key: "/org/gnome/desktop/wm/keybindings/close"
value: "['<Super>q']"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: <super + enter> to fire a terminal - binding
dconf:
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding"
value: "'<Super>Return'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: <super + enter> to fire a terminal - command
dconf:
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command"
value: "'st'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: <super + enter> to fire a terminal - name
dconf:
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name"
value: "'Terminal'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: Shell theme
dconf:
key: "/org/gnome/shell/extensions/user-theme/name"
value: "'Plata-Noir-Compact'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: Gtk theme
dconf:
key: "/org/gnome/desktop/interface/gkt-theme"
value: "'Plata-Noir-Compact'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"
- name: Icon theme
dconf:
key: "/org/gnome/desktop/interface/icon-theme"
value: "'Tela-orange-dark'"
state: present
become: true
become_user: "{{ item.username }}"
with_items: "{{ me }}"

View File

@ -73,7 +73,6 @@
skip_installed: true skip_installed: true
with_items: with_items:
- ttf-ubuntu-mono-derivative-powerline-git - ttf-ubuntu-mono-derivative-powerline-git
- ttf-roboto-mono-powerline-git
- ttf-inconsolata-lgc-for-powerline - ttf-inconsolata-lgc-for-powerline
- ttf-droid-sans-mono-slashed-powerline-git - ttf-droid-sans-mono-slashed-powerline-git
- ttf-literation-mono-powerline-git - ttf-literation-mono-powerline-git

View File

@ -4,6 +4,20 @@
name: autofs name: autofs
state: present state: present
#- name: install nfs
# apt:
# pkg: nfs-kernel-server
# state: present
# when: ansible_distribution == 'Debian'
# notify: restart nfs-server
- name: install nfs
pacman:
pkg: nfs-utils
state: present
when: ansible_distribution != 'Debian'
notify: restart nfs-client
- name: Create NAS share directory - name: Create NAS share directory
file: file:
path: "/media/{{ item.host }}" path: "/media/{{ item.host }}"

View File

@ -0,0 +1,25 @@
---
- name: Install nginx
pacman:
name: nginx
state: present
- name: create cache directy
file:
path: /srv/http/pacman-cache
state: directory
owner: http
group: http
- name: copy nginx config
template:
src: files/nginx.conf
dest: /etc/nginx/nginx.conf
owner: root
group: root
- name: Enable nginx daemon
service:
name: nginx
state: started
enabled: yes

View File

@ -13,12 +13,3 @@
state: present state: present
tags: tags:
- first_deployement - first_deployement
- name: Add deploy user to sudo group
user:
name: "{{ item.username }}"
groups: sudo
append: yes
with_items: '{{ deploy_users }}'
tags:
- first_deployement

View File

@ -15,20 +15,16 @@
insertafter: "^\\[multilib\\]" insertafter: "^\\[multilib\\]"
regexp: "Include = /etc/pacman.d/mirrorlist" regexp: "Include = /etc/pacman.d/mirrorlist"
- name: Update pacman cache - name: Install WINE packages
pacman:
update_cache: yes
- name: Install WINE
pacman: pacman:
name: name:
- lib32-libglvnd # wine has multiple fulfilments for lib32-libgl - lib32-libglvnd
- wine - wine
- winetricks - winetricks
- wine_gecko - wine_gecko
- wine-mono - wine-mono
# Audio
- lib32-alsa-plugins - lib32-alsa-plugins
- lib32-libpulse - lib32-libpulse
- lib32-openal - lib32-openal
state: present state: present
update-cache: yes