From d677cefb6362be091e9ed9a09a0e1f4e3c2210c7 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 21 Jun 2020 20:49:52 +0200 Subject: [PATCH] Move tasks into new general role --- .../files/authorized_keys | 0 .../dotfiles/.composer/vendor/bin/.gitkeep | 0 .../dotfiles/.config/fish/conf.d/pkgs.fish | 0 .../files/dotfiles/.config/fish/config.fish | 0 .../.config/fish/functions/fish_greeting.fish | 0 .../.config/fish/functions/nsreverse.fish | 0 .../.config/fish/functions/nsreverse6.fish | 0 .../files/dotfiles/.config/fish/pkgs/.gitkeep | 0 .../files/dotfiles/.config/git/.gitkeep | 0 .../dotfiles/.config/welcome/colossal.flf | 0 .../.config/welcome/summarizers/01-date.sh | 0 .../.config/welcome/summarizers/02-uptime.sh | 0 .../.config/welcome/summarizers/03-quota.sh | 0 .../.config/welcome/summarizers/04-ram.sh | 0 .../dotfiles/.config/welcome/warners/.gitkeep | 0 .../files/dotfiles/.local/bin/.gitkeep | 0 roles/{terminal => general}/tasks/main.yml | 33 +++++++------------ .../templates/gitconfig.j2 | 0 .../templates/index.html.j2 | 0 roles/host-site/tasks/main.yml | 11 ------- roles/{terminal => shell}/handlers/main.yml | 0 roles/shell/tasks/main.yml | 22 +++++++++++++ site.yml | 4 +-- 23 files changed, 35 insertions(+), 35 deletions(-) rename roles/{terminal => general}/files/authorized_keys (100%) rename roles/{terminal => general}/files/dotfiles/.composer/vendor/bin/.gitkeep (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/conf.d/pkgs.fish (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/config.fish (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/functions/fish_greeting.fish (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/functions/nsreverse.fish (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/functions/nsreverse6.fish (100%) rename roles/{terminal => general}/files/dotfiles/.config/fish/pkgs/.gitkeep (100%) rename roles/{terminal => general}/files/dotfiles/.config/git/.gitkeep (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/colossal.flf (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/summarizers/01-date.sh (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/summarizers/02-uptime.sh (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/summarizers/03-quota.sh (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/summarizers/04-ram.sh (100%) rename roles/{terminal => general}/files/dotfiles/.config/welcome/warners/.gitkeep (100%) rename roles/{terminal => general}/files/dotfiles/.local/bin/.gitkeep (100%) rename roles/{terminal => general}/tasks/main.yml (52%) rename roles/{terminal => general}/templates/gitconfig.j2 (100%) rename roles/{host-site => general}/templates/index.html.j2 (100%) delete mode 100644 roles/host-site/tasks/main.yml rename roles/{terminal => shell}/handlers/main.yml (100%) create mode 100644 roles/shell/tasks/main.yml diff --git a/roles/terminal/files/authorized_keys b/roles/general/files/authorized_keys similarity index 100% rename from roles/terminal/files/authorized_keys rename to roles/general/files/authorized_keys diff --git a/roles/terminal/files/dotfiles/.composer/vendor/bin/.gitkeep b/roles/general/files/dotfiles/.composer/vendor/bin/.gitkeep similarity index 100% rename from roles/terminal/files/dotfiles/.composer/vendor/bin/.gitkeep rename to roles/general/files/dotfiles/.composer/vendor/bin/.gitkeep diff --git a/roles/terminal/files/dotfiles/.config/fish/conf.d/pkgs.fish b/roles/general/files/dotfiles/.config/fish/conf.d/pkgs.fish similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/conf.d/pkgs.fish rename to roles/general/files/dotfiles/.config/fish/conf.d/pkgs.fish diff --git a/roles/terminal/files/dotfiles/.config/fish/config.fish b/roles/general/files/dotfiles/.config/fish/config.fish similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/config.fish rename to roles/general/files/dotfiles/.config/fish/config.fish diff --git a/roles/terminal/files/dotfiles/.config/fish/functions/fish_greeting.fish b/roles/general/files/dotfiles/.config/fish/functions/fish_greeting.fish similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/functions/fish_greeting.fish rename to roles/general/files/dotfiles/.config/fish/functions/fish_greeting.fish diff --git a/roles/terminal/files/dotfiles/.config/fish/functions/nsreverse.fish b/roles/general/files/dotfiles/.config/fish/functions/nsreverse.fish similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/functions/nsreverse.fish rename to roles/general/files/dotfiles/.config/fish/functions/nsreverse.fish diff --git a/roles/terminal/files/dotfiles/.config/fish/functions/nsreverse6.fish b/roles/general/files/dotfiles/.config/fish/functions/nsreverse6.fish similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/functions/nsreverse6.fish rename to roles/general/files/dotfiles/.config/fish/functions/nsreverse6.fish diff --git a/roles/terminal/files/dotfiles/.config/fish/pkgs/.gitkeep b/roles/general/files/dotfiles/.config/fish/pkgs/.gitkeep similarity index 100% rename from roles/terminal/files/dotfiles/.config/fish/pkgs/.gitkeep rename to roles/general/files/dotfiles/.config/fish/pkgs/.gitkeep diff --git a/roles/terminal/files/dotfiles/.config/git/.gitkeep b/roles/general/files/dotfiles/.config/git/.gitkeep similarity index 100% rename from roles/terminal/files/dotfiles/.config/git/.gitkeep rename to roles/general/files/dotfiles/.config/git/.gitkeep diff --git a/roles/terminal/files/dotfiles/.config/welcome/colossal.flf b/roles/general/files/dotfiles/.config/welcome/colossal.flf similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/colossal.flf rename to roles/general/files/dotfiles/.config/welcome/colossal.flf diff --git a/roles/terminal/files/dotfiles/.config/welcome/summarizers/01-date.sh b/roles/general/files/dotfiles/.config/welcome/summarizers/01-date.sh similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/summarizers/01-date.sh rename to roles/general/files/dotfiles/.config/welcome/summarizers/01-date.sh diff --git a/roles/terminal/files/dotfiles/.config/welcome/summarizers/02-uptime.sh b/roles/general/files/dotfiles/.config/welcome/summarizers/02-uptime.sh similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/summarizers/02-uptime.sh rename to roles/general/files/dotfiles/.config/welcome/summarizers/02-uptime.sh diff --git a/roles/terminal/files/dotfiles/.config/welcome/summarizers/03-quota.sh b/roles/general/files/dotfiles/.config/welcome/summarizers/03-quota.sh similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/summarizers/03-quota.sh rename to roles/general/files/dotfiles/.config/welcome/summarizers/03-quota.sh diff --git a/roles/terminal/files/dotfiles/.config/welcome/summarizers/04-ram.sh b/roles/general/files/dotfiles/.config/welcome/summarizers/04-ram.sh similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/summarizers/04-ram.sh rename to roles/general/files/dotfiles/.config/welcome/summarizers/04-ram.sh diff --git a/roles/terminal/files/dotfiles/.config/welcome/warners/.gitkeep b/roles/general/files/dotfiles/.config/welcome/warners/.gitkeep similarity index 100% rename from roles/terminal/files/dotfiles/.config/welcome/warners/.gitkeep rename to roles/general/files/dotfiles/.config/welcome/warners/.gitkeep diff --git a/roles/terminal/files/dotfiles/.local/bin/.gitkeep b/roles/general/files/dotfiles/.local/bin/.gitkeep similarity index 100% rename from roles/terminal/files/dotfiles/.local/bin/.gitkeep rename to roles/general/files/dotfiles/.local/bin/.gitkeep diff --git a/roles/terminal/tasks/main.yml b/roles/general/tasks/main.yml similarity index 52% rename from roles/terminal/tasks/main.yml rename to roles/general/tasks/main.yml index 72a4edb..1cf79ce 100644 --- a/roles/terminal/tasks/main.yml +++ b/roles/general/tasks/main.yml @@ -6,15 +6,6 @@ key: "{{ item }}" with_file: authorized_keys -- name: Get current shell - shell: "getent passwd {{ ansible_facts.user_id }} | cut -d: -f7" - register: current_shell - changed_when: no - -- name: Change shell to fish - command: chsh --shell /usr/bin/fish - when: "current_shell.stdout != '/usr/bin/fish'" - - name: Copy dotfiles to home directory copy: src: dotfiles/ @@ -34,19 +25,6 @@ - "{{ ansible_facts.env.HOME }}/.bash_history" - "{{ ansible_facts.env.HOME }}/.zcompdump" -- name: Download and update iTerm2 shell integration - get_url: - url: https://iterm2.com/shell_integration/fish - dest: "{{ ansible_facts.env.HOME }}/.config/fish/conf.d/iterm2_integration.fish" - force: yes - -- name: Download and update Oh My Fish! packages - git: - repo: "{{ item.value }}" - dest: "{{ ansible_facts.env.HOME }}/.config/fish/pkgs/{{ item.key }}" - loop: "{{ omf_pkgs | dict2items }}" - notify: Collect fish functions from packages - - name: Disable cron MAILTO cronvar: name: MAILTO @@ -55,3 +33,14 @@ - name: Set up host-specific cronjobs cron: "{{ item }}" loop: "{{ cronjobs.get(ansible_facts.user_id, []) }}" + +- name: Add host domain to Uberspace config + import_role: + name: snapstromegon.uberspace_web_domain + vars: + domain: kodos-{{ ansible_facts.user_id }}.codesignd.net + +- name: Set up host site + template: + src: index.html.j2 + dest: /var/www/virtual/{{ ansible_facts.user_id }}/html/index.html diff --git a/roles/terminal/templates/gitconfig.j2 b/roles/general/templates/gitconfig.j2 similarity index 100% rename from roles/terminal/templates/gitconfig.j2 rename to roles/general/templates/gitconfig.j2 diff --git a/roles/host-site/templates/index.html.j2 b/roles/general/templates/index.html.j2 similarity index 100% rename from roles/host-site/templates/index.html.j2 rename to roles/general/templates/index.html.j2 diff --git a/roles/host-site/tasks/main.yml b/roles/host-site/tasks/main.yml deleted file mode 100644 index 3e58074..0000000 --- a/roles/host-site/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Add host domain to Uberspace config - import_role: - name: snapstromegon.uberspace_web_domain - vars: - domain: kodos-{{ ansible_facts.user_id }}.codesignd.net - -- name: Set up host site - template: - src: index.html.j2 - dest: /var/www/virtual/{{ ansible_facts.user_id }}/html/index.html diff --git a/roles/terminal/handlers/main.yml b/roles/shell/handlers/main.yml similarity index 100% rename from roles/terminal/handlers/main.yml rename to roles/shell/handlers/main.yml diff --git a/roles/shell/tasks/main.yml b/roles/shell/tasks/main.yml new file mode 100644 index 0000000..b3b41ee --- /dev/null +++ b/roles/shell/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: Get current shell + shell: "getent passwd {{ ansible_facts.user_id }} | cut -d: -f7" + register: current_shell + changed_when: no + +- name: Change shell to fish + command: chsh --shell /usr/bin/fish + when: "current_shell.stdout != '/usr/bin/fish'" + +- name: Download and update iTerm2 shell integration + get_url: + url: https://iterm2.com/shell_integration/fish + dest: "{{ ansible_facts.env.HOME }}/.config/fish/conf.d/iterm2_integration.fish" + force: yes + +- name: Download and update Oh My Fish! packages + git: + repo: "{{ item.value }}" + dest: "{{ ansible_facts.env.HOME }}/.config/fish/pkgs/{{ item.key }}" + loop: "{{ omf_pkgs | dict2items }}" + notify: Collect fish functions from packages diff --git a/site.yml b/site.yml index 8a3ba8f..03f5957 100644 --- a/site.yml +++ b/site.yml @@ -5,9 +5,9 @@ - vars/config.yml - vars/installs.yml roles: + - general - homebrew - - host-site - - terminal + - shell - name: Redirect mail from non-mail Uberspaces hosts: "!mail"