From ab8dda9dfbf8541330d5a5bde15308ec768dbc72 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 3 Dec 2024 18:17:53 -0500 Subject: [PATCH] Import tasks rather than including them Imports bring in tasks statically, allowing tags on the import to propagate properly. There is no need for the dynamic behavior of includes, they're just being used for organization. --- dhall/asterisk.dhall | 16 ++-------------- roles/asterisk/tasks/main.yml | 4 ++-- roles/phone-provisioning/tasks/main.yml | 6 +++--- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/dhall/asterisk.dhall b/dhall/asterisk.dhall index f33bd0e..81fbb01 100644 --- a/dhall/asterisk.dhall +++ b/dhall/asterisk.dhall @@ -1,20 +1,8 @@ let Text/concatMapSep = ./Prelude/Text/concatMapSep -let Mailbox = - { Type = { id : Text, context : Text, name : Text, email : Text } - , default = { name = "", email = "" } - } +let Mailbox = ./Asterisk/Mailbox -let Endpoint = - { Type = - { id : Text - , context : Text - , password : Text - , callerid : Text - , mailboxes : List Mailbox.Type - } - , default = { callerid = "", mailboxes = [] : List Mailbox.Type } - } +let Endpoint = ./Asterisk/Endpoint let mailboxes = { correl = Mailbox::{ diff --git a/roles/asterisk/tasks/main.yml b/roles/asterisk/tasks/main.yml index c03a26a..f0cecfa 100644 --- a/roles/asterisk/tasks/main.yml +++ b/roles/asterisk/tasks/main.yml @@ -1,8 +1,8 @@ - name: Configure Asterisk tags: asterisk-configuration - ansible.builtin.include_tasks: + ansible.builtin.import_tasks: file: configure_asterisk.yml - name: Install Voicemail API tags: voicemail-api - ansible.builtin.include_tasks: + ansible.builtin.import_tasks: file: install_voicemail_api.yml diff --git a/roles/phone-provisioning/tasks/main.yml b/roles/phone-provisioning/tasks/main.yml index 9c04825..26a4b57 100644 --- a/roles/phone-provisioning/tasks/main.yml +++ b/roles/phone-provisioning/tasks/main.yml @@ -1,8 +1,8 @@ - name: Install Apache2 - ansible.builtin.include_tasks: + ansible.builtin.import_tasks: file: install_apache2.yml - name: Install TFTPd - ansible.builtin.include_tasks: + ansible.builtin.import_tasks: file: install_tftpd.yml - name: Copy phone provisioning files tags: phone-configuration @@ -10,5 +10,5 @@ src: tftpboot/ dest: /var/lib/tftpboot/ - name: Configure and enable phone provisioning - ansible.builtin.include_tasks: + ansible.builtin.import_tasks: file: configure_provisioning.yml