diff --git a/Bilimbi.yml b/Bilimbi.yml index d0a3e51..f2759f2 100644 --- a/Bilimbi.yml +++ b/Bilimbi.yml @@ -14,7 +14,7 @@ - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/dotfiles.yml - - include: tasks/docker.yml + - include: tasks/deb_docker.yml handlers: - name: restart sshd diff --git a/Choux.yml b/Choux.yml index c00c242..ce768d5 100644 --- a/Choux.yml +++ b/Choux.yml @@ -12,9 +12,10 @@ # - include: tasks/test.yml - include: tasks/ansible.yml - include: tasks/arch_aur.yml + - include: tasks/pacman_cache_server.yml - include: tasks/arch_CLI_packages.yml - include: tasks/prompt.yml - - include: tasks/users.yml + # - include: tasks/users.yml - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/arch_programming.yml @@ -35,7 +36,15 @@ service: name: sshd state: restarted - - name: restart nfs + - name: restart nfs-server service: name: nfs-server state: restarted + - name: restart nfs-client + service: + name: nfs-client + state: restarted + - name: restart autofs + service: + name: autofs + state: restarted diff --git a/Combava.yml b/Combava.yml index 281da53..ec741bf 100644 --- a/Combava.yml +++ b/Combava.yml @@ -14,7 +14,7 @@ - include: tasks/arch_CLI_packages.yml - include: tasks/dd_backup.yml - include: tasks/prompt.yml - - include: tasks/users.yml + # - include: tasks/users.yml - include: tasks/sudo.yml # - include: tasks/ssh.yml - include: tasks/arch_programming.yml diff --git a/Manioc.yml b/Manioc.yml index d73a3fb..d93581c 100644 --- a/Manioc.yml +++ b/Manioc.yml @@ -15,7 +15,7 @@ - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/dotfiles.yml - - include: tasks/docker.yml + - include: tasks/deb_docker.yml handlers: - name: restart sshd diff --git a/Poivre.yml b/Poivre.yml index d0fbf97..02a8297 100644 --- a/Poivre.yml +++ b/Poivre.yml @@ -5,6 +5,7 @@ vars_files: - vars/common.yml - vars/home.yml + - vars/users.yml - vars/Combava.yml tasks: @@ -14,8 +15,8 @@ - include: tasks/arch_aur.yml #- include: tasks/dd_backup.yml - include: tasks/prompt.yml - - include: tasks/users.yml - # - include: tasks/ssh.yml + #- include: tasks/users.yml + - include: tasks/ssh.yml - include: tasks/arch_programming.yml - include: tasks/arch_teacher.yml - include: tasks/arch_gnome.yml @@ -24,8 +25,9 @@ - include: tasks/dotfiles_desktop.yml - include: tasks/home_autofs.yml - include: tasks/laptop.yml + - include: tasks/arch_docker.yml # - include: tasks/nfs_share.yml - #- include: tasks/wine.yml + # - include: tasks/wine.yml # - include: tasks/arch_virtualbox.yml handlers: diff --git a/README.md b/README.md index e42693a..6564696 100644 --- a/README.md +++ b/README.md @@ -16,22 +16,10 @@ Installing Choux 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 -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 diff --git a/files/dotfiles/sshconfig b/files/dotfiles/sshconfig index 07b785c..1e89cf9 100755 --- a/files/dotfiles/sshconfig +++ b/files/dotfiles/sshconfig @@ -28,15 +28,6 @@ Host github PubkeyAcceptedKeyTypes * 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 HostName Choux User lafrite diff --git a/files/dotfiles/tmuxp/enseignement.yml b/files/dotfiles/tmuxp/enseignement.yml index d517587..fef89d0 100644 --- a/files/dotfiles/tmuxp/enseignement.yml +++ b/files/dotfiles/tmuxp/enseignement.yml @@ -1,5 +1,5 @@ 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 windows: diff --git a/files/dotfiles/vifm/vifmrc b/files/dotfiles/vifm/vifmrc index 876395b..5c75089 100644 --- a/files/dotfiles/vifm/vifmrc +++ b/files/dotfiles/vifm/vifmrc @@ -143,6 +143,7 @@ command! make !!make %a command! mkcd :mkdir %a | cd %a command! vgrep vim "+grep %a" command! reload :write | restart +command ln ln -s %f:p %D " ------------------------------------------------------------------------------ diff --git a/files/nginx.conf b/files/nginx.conf new file mode 100644 index 0000000..e3ff10a --- /dev/null +++ b/files/nginx.conf @@ -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; + } + } +} diff --git a/tasks/arch_docker.yml b/tasks/arch_docker.yml index 6776fb5..0fc33ee 100644 --- a/tasks/arch_docker.yml +++ b/tasks/arch_docker.yml @@ -5,3 +5,8 @@ - docker state: present +- name: Enable docker daemon + service: + name: docker + state: started + enabled: yes diff --git a/tasks/arch_gnome.yml b/tasks/arch_gnome.yml index 35d9365..7163548 100644 --- a/tasks/arch_gnome.yml +++ b/tasks/arch_gnome.yml @@ -31,6 +31,7 @@ enabled: no with_items: - dhcpcd + ignore_errors: yes - name: enable service NetworkManager systemd: @@ -61,12 +62,73 @@ use: makepkg skip_installed: true with_items: + - plata-theme - gnome-colors-icon-theme - - ubo-icons - - shadow-icon-theme - - vertex-themes - - vertex-icons-git - numix-icon-theme-git - numix-circle-icon-theme-git + - tela-icon-theme-git become: yes become_user: aur_builder + +- name: to close window + dconf: + key: "/org/gnome/desktop/wm/keybindings/close" + value: "['q']" + state: present + become: true + become_user: "{{ item.username }}" + with_items: "{{ me }}" + +- name: to fire a terminal - binding + dconf: + key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding" + value: "'Return'" + state: present + become: true + become_user: "{{ item.username }}" + with_items: "{{ me }}" + +- name: 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: 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 }}" diff --git a/tasks/arch_graphicals.yml b/tasks/arch_graphicals.yml index 1809429..8b4aad3 100644 --- a/tasks/arch_graphicals.yml +++ b/tasks/arch_graphicals.yml @@ -73,7 +73,6 @@ skip_installed: true with_items: - ttf-ubuntu-mono-derivative-powerline-git - - ttf-roboto-mono-powerline-git - ttf-inconsolata-lgc-for-powerline - ttf-droid-sans-mono-slashed-powerline-git - ttf-literation-mono-powerline-git diff --git a/tasks/docker.yml b/tasks/deb_docker.yml similarity index 100% rename from tasks/docker.yml rename to tasks/deb_docker.yml diff --git a/tasks/home_autofs.yml b/tasks/home_autofs.yml index a789aac..034e3d9 100644 --- a/tasks/home_autofs.yml +++ b/tasks/home_autofs.yml @@ -4,6 +4,20 @@ name: autofs 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 file: path: "/media/{{ item.host }}" diff --git a/tasks/pacman_cache_server.yml b/tasks/pacman_cache_server.yml new file mode 100644 index 0000000..9513496 --- /dev/null +++ b/tasks/pacman_cache_server.yml @@ -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 diff --git a/tasks/sudo.yml b/tasks/sudo.yml index e589ef5..646fe4b 100644 --- a/tasks/sudo.yml +++ b/tasks/sudo.yml @@ -13,12 +13,3 @@ state: present tags: - first_deployement - -- name: Add deploy user to sudo group - user: - name: "{{ item.username }}" - groups: sudo - append: yes - with_items: '{{ deploy_users }}' - tags: - - first_deployement diff --git a/tasks/wine.yml b/tasks/wine.yml index 50f50ac..6824680 100644 --- a/tasks/wine.yml +++ b/tasks/wine.yml @@ -15,20 +15,16 @@ insertafter: "^\\[multilib\\]" regexp: "Include = /etc/pacman.d/mirrorlist" -- name: Update pacman cache +- name: Install WINE packages pacman: - update_cache: yes - -- name: Install WINE - pacman: name: - - lib32-libglvnd # wine has multiple fulfilments for lib32-libgl + - lib32-libglvnd - wine - winetricks - wine_gecko - wine-mono - # Audio - lib32-alsa-plugins - lib32-libpulse - lib32-openal state: present + update-cache: yes