From f337af02b4701939a6b0d35f8ceb3f1d61170953 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 19 Aug 2025 08:48:11 -0400 Subject: [PATCH] add second page to homer, with links to city websites --- ansible-5/roles/homer/files/config.yml | 5 +++++ ansible-5/roles/homer/files/page2.yml | 31 ++++++++++++++++++++++++++ ansible-5/roles/homer/tasks/main.yaml | 7 ++++-- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 ansible-5/roles/homer/files/page2.yml diff --git a/ansible-5/roles/homer/files/config.yml b/ansible-5/roles/homer/files/config.yml index 31c85fb..7535469 100644 --- a/ansible-5/roles/homer/files/config.yml +++ b/ansible-5/roles/homer/files/config.yml @@ -19,6 +19,11 @@ links: url: "https://fontawesome.com/search?q=files&o=r&ic=free&s=solid&ip=classic" target: "_blank" # optional html a tag target attribute + # this will link to a second homer page that will load config from additional-page.yml and keep default config values as in config.yml file + # see url field and assets/additional-page.yml.dist used in this example: + - name: "page 2" + icon: "fas fa-file-alt" + url: "#page2" # Services # First level array represent a group. # Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). diff --git a/ansible-5/roles/homer/files/page2.yml b/ansible-5/roles/homer/files/page2.yml new file mode 100644 index 0000000..239ea21 --- /dev/null +++ b/ansible-5/roles/homer/files/page2.yml @@ -0,0 +1,31 @@ +--- +# Additional page configuration + +# Additional configurations are loaded using its file name, minus the extension, as an anchor (https://#). +# `config.yml` is still used as a base configuration, and all values here will overwrite it, so you don't have to re-defined everything + + +subtitle: "this is another dashboard page" + +# This overwrites message config. Setting it to empty to remove message from this page and keep it only in the main one: +message: ~ + +# as we want to include a differente link here (so we can get back to home page), we need to replicate all links or they will be revome when overwriting the links field: +links: + - name: "Home" + icon: "fas fa-home" + url: "#" + +services: + - name: "Local Cities" + icon: "fa-solid fa-map" + items: + - name: "longueil" + icon: "fa-solid fa-tree-city" + url: "https://longueuil.quebec" + target: "_blank" # optional html a tag target attribute + + - name: "Brossard" + icon: "fa-solid fa-tree-city" + url: "https://brossard.ca" + target: "_blank" diff --git a/ansible-5/roles/homer/tasks/main.yaml b/ansible-5/roles/homer/tasks/main.yaml index b8ba994..52a0dfb 100644 --- a/ansible-5/roles/homer/tasks/main.yaml +++ b/ansible-5/roles/homer/tasks/main.yaml @@ -10,8 +10,11 @@ - name: Copy Homer config file ansible.builtin.copy: - src: config.yml - dest: /srv/dev-disk-by-uuid-5bc063a8-cf51-435d-9105-5987792ecf48/docker-compose/homer/assets/config.yml + src: "{{ item }}" + dest: /srv/dev-disk-by-uuid-5bc063a8-cf51-435d-9105-5987792ecf48/docker-compose/homer/assets/{{ item }} owner: root group: root mode: '0644' + loop: + - config.yml + - page2.yml