We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31f1f24 commit d9d7585Copy full SHA for d9d7585
2 files changed
tests/simple.sql
@@ -0,0 +1,5 @@
1
+CREATE TABLE mytable(
2
+ mynumber int,
3
+ name varchar(255)
4
+);
5
+INSERT INTO mytable VALUES (1, 'test');
tests/tests_input_file.yml
@@ -0,0 +1,26 @@
+- name: Ensure that the role runs with input file
+ hosts: all
+ gather_facts: false
+
+ tasks:
6
+ - name: Run postgresql role with input file
7
+ include_role:
8
+ name: linux-system-roles.postgresql
9
+ vars:
10
+ postgresql_input_file: simple.sql
11
12
+ - meta: flush_handlers
13
14
+ - name: Get content of database
15
+ become: yes
16
+ become_user: postgres
17
+ shell: |
18
+ set -euo pipefail
19
+ echo "SELECT * FROM mytable;" | psql
20
+ register: result
21
+ changed_when: false
22
23
+ - name: Check content of databse
24
+ assert:
25
+ that: >
26
+ "1 row" in result.stdout
0 commit comments