So you are saying that you want: - CONFLUENT_SECURITY_MASTER_KEY be set? - That value be persistent through the remainder of the playbook run?
— Rilindo Foster - Cloud Reliability Architect > On Mar 26, 2022, at 9:57 PM, Arundhati Bhende > <[email protected]> wrote: > > I need to set a playbook level Environment variable after executing some > tasks. The variable needs to be set-up separately on each server by reading > a file on the server – I am told I should use slurp, but do not know how to > use it to define playbook level environment variable. > > Can someone help? > > This is the current version of the playbook > > > - name: server properties > hosts: kafka_broker > vars: > ansible_ssh_extra_args: "-o StrictHostKeyChecking=no" > ansible_host_key_checking: false > date: "{{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }}" > copy_to_dest: "/export/home/kafusr/kafka/secrets" > server_props_loc: "/etc/kafka" > secrets_props_loc: "{{ server_props_loc }}/secrets" > > environment: > CONFLUENT_SECURITY_MASTER_KEY: "” > > tasks: > > - name: Create a directory if it does not exist > file: > path: "{{ copy_to_dest }}" > state: directory > mode: '0755' > > - name: Find files from "{{ server_props_loc }}" > find: > paths: /etc/kafka/ > patterns: "server.properties*" > # ... the rest of the task > register: etc_kafka_server_props > > - name: Find files from "{{ secrets_props_loc }}" > find: > paths: /etc/kafka/secrets > patterns: "*" > # ... the rest of the task > register: etc_kafka_secrets_props > > - name: Copy the files > copy: > src: "{{ item.path }}" > dest: "{{ copy_to_dest }}" > remote_src: yes > loop: "{{ etc_kafka_server_props.files + etc_kafka_secrets_props.files > }}" > > > Need help is setting up CONFLUENT_SECURITY_MASTER_KEY after the copy files > task to read the a file from secrets directory using slurp, and have it > avaibale at playbook level > > Regards > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%40prudential.com > > <https://groups.google.com/d/msgid/ansible-project/CBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%40prudential.com?utm_medium=email&utm_source=footer>. -- This email and its attachments are confidential and may be privileged. Any unauthorized use or disclosure is prohibited. If you receive this email in error, please notify the sender and permanently delete the original without forwarding, making any copies or disclosing its contents. NextCapital is a brand name representing NextCapital Group, Inc. and its subsidiaries, NextCapital Software, Inc. and NextCapital Advisers, Inc. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/47C58C8A-F1C1-47D5-A942-07E2F924C1F5%40nextcapital.com.
