Added source field to service database

This commit is contained in:
Ashish D'Souza 2023-07-23 17:29:31 -04:00
parent 5b9bf61ef4
commit 274555a8bc
1 changed files with 3 additions and 2 deletions

View File

@ -60,13 +60,14 @@
login_user: '{{homelab_config.database.user}}' login_user: '{{homelab_config.database.user}}'
login_password: '{{homelab_config.database.password}}' login_password: '{{homelab_config.database.password}}'
db: '{{homelab_config.database.name}}' db: '{{homelab_config.database.name}}'
query: 'INSERT INTO service (name, host, config) VALUES (%s, %s, %s) ON CONFLICT DO NOTHING;' query: 'INSERT INTO service (name, host, source, config) VALUES (%s, %s, %s, %s) ON CONFLICT DO NOTHING;'
positional_args: positional_args:
- '{{item.name}}' - '{{item.name}}'
- '{{item.host}}' - '{{item.host}}'
- '{{item.source}}'
- '{{item.config}}' - '{{item.config}}'
with_items: with_items:
- {name: archer_a9_router_rebooter, host: '{{ansible_hostname}}', config: '{{archer_a9_router_rebooter_config|to_json}}'} - {name: archer_a9_router_rebooter, host: '{{ansible_hostname}}', source: gitea/ashish/archer-a9-router-rebooter/master, config: '{{archer_a9_router_rebooter_config|to_json}}'}
- name: Insert into Postgres table service_data - name: Insert into Postgres table service_data
community.postgresql.postgresql_query: community.postgresql.postgresql_query:
login_host: '{{homelab_config.database.host}}' login_host: '{{homelab_config.database.host}}'