diff --git a/roles/workstation/defaults/main.yml b/roles/workstation/defaults/main.yml index fb7d5e9..47c238d 100644 --- a/roles/workstation/defaults/main.yml +++ b/roles/workstation/defaults/main.yml @@ -7,6 +7,7 @@ pacman_utils: - cups-pdf - avahi - nss-mdns + - networkmanager pacman_cli: - git-annex @@ -94,6 +95,23 @@ pacman_programming: - nodejs - yarn +pacman_gnome: + - gnome + - gdm + - gnome-tweaks + - gparted + - transmission-gtk + - quodlibet + - network-manager-applet + - gnome-keyring + - grsync + - soundconverter + - picard + - shotwell + - pitivi + - seahorse + - python-psutil + pacman_pkgs: - "{{ pacman_utils }}" - "{{ pacman_cli }}" @@ -125,7 +143,11 @@ aur_pkgs: - "{{ aur_fonts }}" - "{{ aur_work }}" + +# Gnome +gnome_environnement: false + # Autofs autofs: - host: nas + - host: nas diff --git a/roles/workstation/meta/main.yml b/roles/workstation/meta/main.yml deleted file mode 100644 index c572acc..0000000 --- a/roles/workstation/meta/main.yml +++ /dev/null @@ -1,52 +0,0 @@ -galaxy_info: - author: your name - description: your role description - company: your company (optional) - - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - - # Choose a valid license ID from https://spdx.org - some suggested licenses: - # - BSD-3-Clause (default) - # - MIT - # - GPL-2.0-or-later - # - GPL-3.0-only - # - Apache-2.0 - # - CC-BY-4.0 - license: license (GPL-2.0-or-later, MIT, etc) - - min_ansible_version: 2.1 - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/workstation/molecule/default/converge.yml b/roles/workstation/molecule/default/converge.yml index 5762728..74ace48 100644 --- a/roles/workstation/molecule/default/converge.yml +++ b/roles/workstation/molecule/default/converge.yml @@ -1,17 +1,23 @@ --- - name: Converge hosts: all + become: true vars: pacman_pkgs: - "{{ pacman_utils }}" aur_pkgs: - "{{ aur_utils }}" + pre_tasks: - - name: Install pkgs + - name: Update cache community.general.pacman: update_cache: true - become: true + - name: set AUR + include_role: + name: "../arch_aur" + tasks: - name: "Include workstation" include_role: name: "workstation" + diff --git a/roles/workstation/molecule/default/molecule.yml b/roles/workstation/molecule/default/molecule.yml index 748eb79..70718f7 100644 --- a/roles/workstation/molecule/default/molecule.yml +++ b/roles/workstation/molecule/default/molecule.yml @@ -4,8 +4,11 @@ dependency: driver: name: vagrant platforms: - - name: instance + - name: archlinux + box: "archlinux/archlinux" provisioner: name: ansible verifier: name: testinfra + options: + sudo: true diff --git a/roles/workstation/tasks/arch.yml b/roles/workstation/tasks/arch.yml index ac42832..645b3ab 100644 --- a/roles/workstation/tasks/arch.yml +++ b/roles/workstation/tasks/arch.yml @@ -21,3 +21,7 @@ with_items: "{{ aur_pkgs }}" become: yes become_user: aur_builder + +- name: Install gnome environnement + import_tasks: gnome.yml + when: gnome_environnement diff --git a/roles/workstation/tasks/gnome.yml b/roles/workstation/tasks/gnome.yml new file mode 100644 index 0000000..e57ad79 --- /dev/null +++ b/roles/workstation/tasks/gnome.yml @@ -0,0 +1,13 @@ +--- +# tasks file for gnome +- name: Install gnome pkgs + community.general.pacman: + name: "{{ item }}" + state: present + with_items: "{{ pacman_gnome }}" + when: ansible_os_family == "Archlinux" + +- name: enable service gdm + systemd: + name: gdm + enabled: yes diff --git a/roles/workstation/tasks/home_mounts.yml b/roles/workstation/tasks/home_mounts.yml index eae6f6d..7784f83 100644 --- a/roles/workstation/tasks/home_mounts.yml +++ b/roles/workstation/tasks/home_mounts.yml @@ -1,18 +1,30 @@ --- -- name: Create NAS share directory +- name: Create auto host share directory file: path: "/media/{{ item.host }}" state: directory with_items: "{{ autofs }}" -- name: Activate NAS shares for autofs +- name: Activate host shares for autofs lineinfile: path: /etc/autofs/auto.master line: "/media/{{ item.host }} /etc/autofs/auto.{{ item.host }} --timeout=60 --browse" with_items: "{{ autofs }}" -- name: NAS autofs config file +- name: autofs config file template: src: "files/autofs.{{ item.host }}" dest: "/etc/autofs/auto.{{ item.host }}" with_items: "{{ autofs }}" + +- name: enable service nfs + systemd: + name: nfs-client.target + enabled: yes + state: started + +- name: Enable autofs daemon + service: + name: autofs + state: started + enabled: yes diff --git a/roles/workstation/tasks/main.yml b/roles/workstation/tasks/main.yml index 8ef7b7b..7e3332d 100644 --- a/roles/workstation/tasks/main.yml +++ b/roles/workstation/tasks/main.yml @@ -2,7 +2,6 @@ # tasks file for workstation - name: Install for arch import_tasks: arch.yml - when: ansible_os_family == "Archlinux" - name: enable service cups systemd: @@ -23,14 +22,19 @@ enabled: yes state: started -- name: enable service nfs +- name: disable old network services systemd: - name: nfs-client.target - enabled: yes - state: started + name: '{{ item }}' + enabled: no + with_items: + - dhcpcd + ignore_errors: yes -- name: Enable autofs daemon - service: - name: autofs - state: started +- name: enable service NetworkManager + systemd: + name: NetworkManager enabled: yes + +- name: activate autofs + import_tasks: home_mounts.yml + when: autofs | length > 0