From bac4eabc5d04602139db0e60d4c94aaec826cc4b Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 24 Feb 2021 17:39:50 +0100 Subject: [PATCH] multiple changes --- .../TUXEDO-Book-XP1511.universe.local.yml | 67 +++++++++------ hosts | 57 +++++++++++- local.yml | 74 +++++++++++++--- roles/base/tasks/main.yml | 30 +++---- roles/base/tasks/users/rene.yml | 32 +++++++ roles/base/tasks/users/root.yml | 18 ++-- roles/server/tasks/main.yml | 3 + roles/workstation/tasks/main.yml | 86 +++++++++++++++++++ roles/workstation/tasks/users/rene.yml | 14 +++ 9 files changed, 312 insertions(+), 69 deletions(-) create mode 100644 roles/server/tasks/main.yml create mode 100644 roles/workstation/tasks/main.yml create mode 100644 roles/workstation/tasks/users/rene.yml diff --git a/host_vars/TUXEDO-Book-XP1511.universe.local.yml b/host_vars/TUXEDO-Book-XP1511.universe.local.yml index b3dbfc7..454285c 100644 --- a/host_vars/TUXEDO-Book-XP1511.universe.local.yml +++ b/host_vars/TUXEDO-Book-XP1511.universe.local.yml @@ -2,34 +2,6 @@ ssh_port: 22 ssh_users: rene -#application selection -autofs: true -borgbackup: true -brave: true -broot: true -chromium: true -docker: false -firefox: true -games: true -gimp: true -google_chrome: false -joplin: true -keepass: true -keepassxc: true -libreoffice: true -midnightcommander: true -nextcloud_client: true -nvidia: true -pacaur: true -ranger: true -syncthing: true -thunderbird: true -vifm: true -virtualbox: true -vivaldi: false -yay: false -yubikey: true - #purpose selection database: false development: true @@ -54,3 +26,42 @@ gnome: false kde: true mate: false xfce: false + +#application selection +alacritty: true +alsa: true +autofs: true +bashtop: true +borgbackup: true +brave: true +broot: true +chromium: true +clonezilla: true +cmatrix: true +davinci-resolve: true +dbeaver: true +digikam: true +dislocker: true +docker: false +exa: true +filelight: true +firefox: true +games: true +gimp: true +google_chrome: false +joplin: true +keepass: true +keepassxc: true +libreoffice: true +midnightcommander: true +nextcloud_client: true +nvidia: true +pacaur: true +ranger: true +syncthing: true +thunderbird: true +vifm: true +virtualbox: true +vivaldi: false +yay: false +yubikey: true diff --git a/hosts b/hosts index 9c81349..9f2c935 100644 --- a/hosts +++ b/hosts @@ -1,9 +1,58 @@ -[workstation] -endor.universe.local -endorvm.universe.local -tuxedo-book-xp1511.universe.local +[workstation:children] +development +mobile +photo_editing +video_editing [server] coruscant.universe.local mewimeet.de mewitoot.de + + +[database] +coruscant.universe.local +mewimeet.de +mewitoot.de + +[development] +endor.universe.local +endorvm.universe.local +tuxedo-book-xp1511.universe.local + +[dhcpserver] +coruscant.universe.local + +[fileserver] +coruscant.universe.local + +[mailserver] +coruscant.universe.local +mewitoot.de + +[mobile] +tuxedo-book-xp1511.universe.local + +[nameserver] +coruscant.universe.local + +[photo_editing] +endor.universe.local +endorvm.universe.local +tuxedo-book-xp1511.universe.local + +[printspooler] +coruscant.universe.local + +[proxyserver] +coruscant.universe.local + +[video_editing] +endor.universe.local +endorvm.universe.local +tuxedo-book-xp1511.universe.local + +[webserver] +coruscant.universe.local +mewimeet.de +mewitoot.de diff --git a/local.yml b/local.yml index cb07ec6..0a9733d 100644 --- a/local.yml +++ b/local.yml @@ -6,11 +6,11 @@ pre_tasks: - name: pre-run | update apt repository (debian, ubuntu, etc.) apt: update_cache=yes - changed_when: False + changed_when: false when: ansible_distribution in ["Debian", "Ubuntu"] - name: pre-run | update pacman repository (arch) pacman: update_cache=yes - changed_when: False + changed_when: false when: ansible_distribution == 'Archlinux' - name: pre-run |update portage repository (gentoo) portage: @@ -36,6 +36,54 @@ roles: - server +- hosts: webserver + tags: server,webserver + become: true + roles: + - webserver + +- hosts: mailserver + tags: server,mailserver + become: true + roles: + - mailserver + +- hosts: database + tags: server,database + become: true + roles: + - database + +- hosts: dhcpserver + tags: server,dhcpserver + become: true + roles: + - dhcpserver + +- hosts: fileserver + tags: server,fileserver + become: true + roles: + - fileserver + +- hosts: nameserver + tags: server,nameserver + become: true + roles: + - nameserver + +- hosts: printspooler + tags: server,printspooler + become: true + roles: + - printspooler + +- hosts: proxyserver + tags: server,proxyserver + become: true + roles: + - proxyserver + # end of roles; cleanup and reporting - hosts: all become: true @@ -61,17 +109,17 @@ changed_when: false when: ansible_distribution == "Archlinux" - - name: send completion alert - include_tasks: playbooks/send_completion_alert.yml - tags: always - when: - - task_failed is not defined + # - name: send completion alert + # include_tasks: playbooks/send_completion_alert.yml + # tags: always + # when: + # - task_failed is not defined - - name: send failure alert - include_tasks: playbooks/send_failure_alert.yml - tags: always - when: - - task_failed is defined - - task_failed == true + # - name: send failure alert + # include_tasks: playbooks/send_failure_alert.yml + # tags: always + # when: + # - task_failed is defined + # - task_failed == true # vim: ts=2 sw=2 fdm=indent diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 18552ea..ed37c0d 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -1,5 +1,5 @@ # Load distro-specific variables -- include_vars: "{{ ansible_distribution }}.yml +- include_vars: "{{ ansible_distribution }}.yml" tags: always - block: @@ -8,24 +8,24 @@ - import_tasks: users/root.yml # Set up the ansible environment - - import_tasks: ansible_setup.yml + # - import_tasks: ansible_setup.yml # install software - - import_tasks: software/repositories.yml - - import_tasks: software/packages_development.yml - - import_tasks: software/packages_cleanup.yml - - import_tasks: software/packages_pip.yml - - import_tasks: software/packages_utilities.yml + # - import_tasks: software/repositories.yml + # - import_tasks: software/packages_development.yml + # - import_tasks: software/packages_cleanup.yml + # - import_tasks: software/packages_pip.yml + # - import_tasks: software/packages_utilities.yml # Perform remeining tasks: - - import_tasks: system_setup/clock.yml - - import_tasks: system_setup/cron.yml - - import_tasks: system_setup/locale.yml - - import_tasks: system_setup/logging.yml - - import_tasks: system_setup/memory.yml - - import_tasks: system_setup/microcode.yml - - import_tasks: system_setup/openssh.yml - - import_tasks: system_setup/scripts.yml + # - import_tasks: system_setup/clock.yml + # - import_tasks: system_setup/cron.yml + # - import_tasks: system_setup/locale.yml + # - import_tasks: system_setup/logging.yml + # - import_tasks: system_setup/memory.yml + # - import_tasks: system_setup/microcode.yml + # - import_tasks: system_setup/openssh.yml + # - import_tasks: system_setup/scripts.yml rescue: - set_fact: task_failed=true diff --git a/roles/base/tasks/users/rene.yml b/roles/base/tasks/users/rene.yml index e69de29..c8cdae0 100644 --- a/roles/base/tasks/users/rene.yml +++ b/roles/base/tasks/users/rene.yml @@ -0,0 +1,32 @@ +- name: users | rene | ensure account is locked + user: + name: rrene + password_lock: yes + +- name: users | rene | create config directories + file: + path: /rene/{{ item.dir }} + state: directory + owner: rene + group: rene + mode: 0700 + with_items: + - {dir: '.vim'} + - {dir: '.vim/colors'} + tags: dotfiles + +- name: users | rene | copy dotfiles + copy: + src: users/rene/{{ item.src }} + dest: /rene/{{ item.dest }} + owner: rene + group: rene + mode: 0600 + with_items: + - {src: 'bash/bashrc', dest: '.bashrc'} + - {src: 'bash/bash_profile', dest: '.bash_profile'} + - {src: 'bash/profile', dest: '.profile'} + - {src: 'tmux/tmux.conf', dest: '.tmux.conf'} + - {src: 'vim/vimrc', dest: '.vimrc'} + - {src: 'zsh/zshrc', dest: '.zshrc'} + tags: dotfiles diff --git a/roles/base/tasks/users/root.yml b/roles/base/tasks/users/root.yml index 7ca3667..62be074 100644 --- a/roles/base/tasks/users/root.yml +++ b/roles/base/tasks/users/root.yml @@ -11,11 +11,11 @@ group: root mode: 0700 with_items: - - { dir: '.vim' } - - { dir: '.vim/colors' } + - {dir: '.vim'} + - {dir: '.vim/colors'} tags: dotfiles --name: users | root | copy dotfiles +- name: users | root | copy dotfiles copy: src: users/root/{{ item.src }} dest: /root/{{ item.dest }} @@ -23,10 +23,10 @@ group: root mode: 0600 with_items: - - { src: 'bash/bashrc', dest: '.bashrc' } - - { src: 'bash/bash_profile', dest: '.bash_profile' } - - { src: 'bash/profile', dest: '.profile' } - - { src: 'tmux/tmux.conf' dest: '.tmux.conf' } - - { src: 'vim/vimrc', dest: '.vimrc' } - - { src: 'zsh/zshrc', dest: '.zshrc' } + - {src: 'bash/bashrc', dest: '.bashrc'} + - {src: 'bash/bash_profile', dest: '.bash_profile'} + - {src: 'bash/profile', dest: '.profile'} + - {src: 'tmux/tmux.conf', dest: '.tmux.conf'} + - {src: 'vim/vimrc', dest: '.vimrc'} + - {src: 'zsh/zshrc', dest: '.zshrc'} tags: dotfiles diff --git a/roles/server/tasks/main.yml b/roles/server/tasks/main.yml new file mode 100644 index 0000000..e337467 --- /dev/null +++ b/roles/server/tasks/main.yml @@ -0,0 +1,3 @@ +# Load distro specific variables +- include_vars: "{{ ansible_distribution }}.yml" + tags: always diff --git a/roles/workstation/tasks/main.yml b/roles/workstation/tasks/main.yml new file mode 100644 index 0000000..bce2d58 --- /dev/null +++ b/roles/workstation/tasks/main.yml @@ -0,0 +1,86 @@ +# Load distro-specific variables +- include_vars: "{{ ansible_distribution }}.yml" + tags: always + +- block: + ## User configs + - import_tasks: users/rene.yml + + ## desktop environments + + # - include_tasks: desktop_environments/mate/appearance.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/caja.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/keybindings.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/packages.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/peripherals.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/terminal.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/mate/workspace_settings.yml + # when: mate is defined and mate == true + + # - include_tasks: desktop_environments/gnome/appearance.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/keybindings.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/nautilus.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/packages.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/peripherals.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/shell_settings.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/terminal.yml + # when: gnome is defined and gnome == true + + # - include_tasks: desktop_environments/gnome/tracker.yml + # when: gnome is defined and gnome == true + + ## system setup + # - import_tasks: system_setup/autofs.yml + # - import_tasks: system_setup/scripts.yml + # - import_tasks: system_setup/tweaks.yml + ## install software + # - import_tasks: software/audacious.yml + # - import_tasks: software/audacity.yml + # - import_tasks: software/codecs.yml + # - import_tasks: software/chromium.yml + # - import_tasks: software/darktable.yml + # - import_tasks: software/firefox.yml + # - import_tasks: software/foliate.yml + # - import_tasks: software/google_chrome.yml + # - import_tasks: software/glimpse.yml + # - import_tasks: software/kdenlive.yml + # - import_tasks: software/keepassxc.yml + # - import_tasks: software/libreoffice.yml + # - import_tasks: software/linode-cli.yml + # - import_tasks: software/lutris.yml + # - import_tasks: software/mattermost.yml + # - import_tasks: software/misc_games.yml + # - import_tasks: software/misc_packages.yml + # - import_tasks: software/steam.yml + # - import_tasks: software/syncthing.yml + # - import_tasks: software/thunderbird.yml + # - import_tasks: software/virtualbox.yml + # - import_tasks: software/vivaldi.yml + # - import_tasks: software/vlc.yml + + rescue: + - set_fact: task_failed=true diff --git a/roles/workstation/tasks/users/rene.yml b/roles/workstation/tasks/users/rene.yml new file mode 100644 index 0000000..a2cc502 --- /dev/null +++ b/roles/workstation/tasks/users/rene.yml @@ -0,0 +1,14 @@ +- name: users | rene | remove preinstalled clutter from home directory + file: + path: /home/rene/{{ item }} + state: absent + with_items: + - examples.desktop + - Desktop + - Documents + - Downloads + - Music + - Pictures + - Public + - Templates + - Videos