diff --git a/tasks/system_cfg/font.yml b/tasks/system_cfg/font.yml new file mode 100644 index 0000000000000000000000000000000000000000..6de96ae3774d07ff88818f7670e57b144aa8a0a3 --- /dev/null +++ b/tasks/system_cfg/font.yml @@ -0,0 +1,17 @@ +--- + +- name: FONT | JetBrainsMono presence + when: inventory_hostname in groups.station + ansible.builtin.find: + path: "/usr/local/share/fonts/" + patterns: "JetBrainsMono*" + recurse: yes + register: font_presence + +- name: FONT | install JetBrainsMono font + when: (inventory_hostname in groups.station) and + (font_presence.matched < 50) + ansible.builtin.unarchive: + dest: "/usr/local/share/" + remote_src: yes + src: https://download.jetbrains.com/fonts/JetBrainsMono-2.242.zip diff --git a/tasks/system_cfg/main.yml b/tasks/system_cfg/main.yml index 991e47ba41f21bffc0fa5e49dae6670a776fb283..ff73bb2ca6529be3f0e38e6e2904b1fbf61a814e 100644 --- a/tasks/system_cfg/main.yml +++ b/tasks/system_cfg/main.yml @@ -6,11 +6,11 @@ tasks: - - name: "IMPORT_TASKS | root" - ansible.builtin.import_tasks: root.yml + - name: IMPORT_TASKS | font + ansible.builtin.import_tasks: font.yml - - name: "IMPORT_TASKS | ntp" + - name: IMPORT_TASKS | ntp ansible.builtin.import_tasks: ntp.yml - - name: "IMPORT_TASKS | {{ my_user }}" - ansible.builtin.import_tasks: my_user.yml + - name: IMPORT_TASKS | shell + ansible.builtin.import_tasks: shell.yml diff --git a/tasks/system_cfg/root.yml b/tasks/system_cfg/root.yml deleted file mode 100644 index 1b1e80e2561d733a4d33a95749abd0db096c6ce6..0000000000000000000000000000000000000000 --- a/tasks/system_cfg/root.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- - -- name: ROOT | dotfiles presence - become: no - ansible.builtin.copy: - src: "{{ item }}" - dest: "/root/.{{ item | basename }}" - mode: 0640 - owner: root - group: root - with_fileglob: - ../user_cfg/files/dotfiles/* - loop_control: - label: "{{ item | basename }}" - -- name: ROOT | ZSH files absence - become: no - ansible.builtin.file: - path: "/etc/zsh/zlogin" - state: absent - -- name: ROOT | Set ZSH for shell - become: no - ansible.builtin.user: - name: root - shell: /bin/zsh - state: present - -- name: ROOT | TEMP-FIX font dir absence - become: no - ansible.builtin.file: - path: "/usr/local/share/fonts/fonts/" - state: absent - -- name: ROOT | JetBrainsMono presence - become: no - ansible.builtin.find: - path: "/usr/local/share/fonts/" - patterns: "JetBrainsMono*" - recurse: yes - register: font_presence - -- name: ROOT | install JetBrainsMono font - become: no - when: font_presence.matched < 50 - ansible.builtin.unarchive: - dest: "/usr/local/share/" - remote_src: yes - src: https://download.jetbrains.com/fonts/JetBrainsMono-2.242.zip diff --git a/tasks/system_cfg/my_user.yml b/tasks/system_cfg/shell.yml similarity index 65% rename from tasks/system_cfg/my_user.yml rename to tasks/system_cfg/shell.yml index 35b0a13aefa408ab749edbb0256b65c69659ba82..0f39c034ed4de16dda7c2a770e77043002c2a808 100644 --- a/tasks/system_cfg/my_user.yml +++ b/tasks/system_cfg/shell.yml @@ -1,7 +1,6 @@ --- -- name: MY USER | set zsh for shell - become: no +- name: "SHELL | set zsh for {{ my_user }}" ansible.builtin.user: name: "{{ my_user }}" shell: /bin/zsh diff --git a/tasks/user_cfg/my_user.yml b/tasks/user_cfg/my_user.yml index a1b37a5cb15d92a14669ccc2876f7b9b890b0d1b..d1edc6209c357a7b8cb08bf18ef1470fc7062561 100644 --- a/tasks/user_cfg/my_user.yml +++ b/tasks/user_cfg/my_user.yml @@ -13,14 +13,8 @@ loop_control: label: "{{ item | basename }}" -- name: MY USER | set zsh for shell - become: no - ansible.builtin.user: - name: "{{ my_user }}" - shell: /bin/zsh - state: present - - name: MY USER | ssh config + become: yes ansible.builtin.template: src: templates/ssh_config.j2 dest: "/home/{{ my_user }}/.ssh/config" @@ -37,6 +31,7 @@ state: directory - name: INCLUDE_VARS | git + when: inventory_hostname in groups.station ansible.builtin.include_vars: "vars/git.yml" - name: MY USER | clone git repos @@ -63,6 +58,8 @@ state: directory - name: MY USER | gps prune config + become: yes + when: inventory_hostname in groups.station ansible.builtin.template: src: templates/pruneconfig.j2 dest: "/home/{{ my_user }}/.pruneconfig" diff --git a/tasks/user_cfg/root.yml b/tasks/user_cfg/root.yml index cd87761cd085bf75ceae507e9f74fb2e362d32c0..d55dca4ec86c0a8063e99f2bb8159c0e47ed4b31 100644 --- a/tasks/user_cfg/root.yml +++ b/tasks/user_cfg/root.yml @@ -1,6 +1,6 @@ --- -- name: ROOT | dotfiles presence +- name: ROOT | dotfiles become: no ansible.builtin.copy: src: "{{ item }}" @@ -13,37 +13,9 @@ loop_control: label: "{{ item | basename }}" -- name: ROOT | ZSH files absence - become: no - ansible.builtin.file: - path: "/etc/zsh/zlogin" - state: absent - -- name: ROOT | Set ZSH for shell +- name: ROOT | set zsh for shell become: no ansible.builtin.user: name: root shell: /bin/zsh state: present - -- name: ROOT | TEMP-FIX font dir absence - become: no - ansible.builtin.file: - path: "/usr/local/share/fonts/fonts/" - state: absent - -- name: ROOT | JetBrainsMono presence - become: no - ansible.builtin.find: - path: "/usr/local/share/fonts/" - patterns: "JetBrainsMono*" - recurse: yes - register: font_presence - -- name: ROOT | install JetBrainsMono font - become: no - when: font_presence.matched < 50 - ansible.builtin.unarchive: - dest: "/usr/local/share/" - remote_src: yes - src: https://download.jetbrains.com/fonts/JetBrainsMono-2.242.zip