|
| 1 | +# Initialises eda-server with some basic stuff for development and testing. |
| 2 | +# Ansible module docs: https://galaxy.ansible.com/ui/repo/published/ansible/eda/docs/ |
| 3 | + |
| 4 | +- hosts: localhost |
| 5 | + connection: local |
| 6 | + gather_facts: no |
| 7 | + vars: |
| 8 | + # Development environment defaults |
| 9 | + # You can override these values or use environment variables |
| 10 | + # CONTROLLER_HOST, CONTROLLER_USERNAME, CONTROLLER_PASSWORD |
| 11 | + controller_host: https://localhost:8443 |
| 12 | + controller_username: admin |
| 13 | + controller_password: testpass |
| 14 | + organization_name: Default |
| 15 | + validate_certs: no |
| 16 | + module_defaults: |
| 17 | + group/ansible.eda.eda: |
| 18 | + controller_host: "{{ controller_host }}" |
| 19 | + controller_username: "{{ controller_username }}" |
| 20 | + controller_password: "{{ controller_password }}" |
| 21 | + validate_certs: "{{ validate_certs }}" |
| 22 | + tasks: |
| 23 | + - name: Import sample project |
| 24 | + ansible.eda.project: |
| 25 | + organization_name: "{{ organization_name }}" |
| 26 | + url: https://github.com/ansible/eda-sample-project |
| 27 | + name: Eda sample project |
| 28 | + |
| 29 | + - name: Create default upstream decision environment |
| 30 | + ansible.eda.decision_environment: |
| 31 | + organization_name: "{{ organization_name }}" |
| 32 | + name: Upstream decision environment |
| 33 | + image_url: quay.io/ansible/ansible-rulebook:main |
| 34 | + |
| 35 | + - name: Create a credential for a basic event stream |
| 36 | + ansible.eda.credential: |
| 37 | + organization_name: "{{ organization_name }}" |
| 38 | + name: Basic event stream credential |
| 39 | + credential_type_name: Basic Event Stream |
| 40 | + inputs: |
| 41 | + username: secret |
| 42 | + password: secret |
| 43 | + |
| 44 | + - name: Create a basic event stream |
| 45 | + ansible.eda.event_stream: |
| 46 | + organization_name: "{{ organization_name }}" |
| 47 | + name: Basic event stream |
| 48 | + credential_name: Basic event stream credential |
| 49 | + |
| 50 | + - name: Get and print the url of the basic event stream |
| 51 | + block: |
| 52 | + - name: Get the event stream generated |
| 53 | + register: event_stream_data |
| 54 | + ansible.eda.event_stream_info: |
| 55 | + name: Basic event stream |
| 56 | + |
| 57 | + - name: Print the event stream url |
| 58 | + debug: |
| 59 | + msg: "Basic Event Stream URL: {{ event_stream_data.event_streams[0].url }}" |
| 60 | + |
| 61 | + |
| 62 | + |
0 commit comments