----------
ID: postgres_schema-db2-public
Function: postgres_schema.present
Name: public
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 425, in _run
pwd.getpwnam(runas)
KeyError: "getpwnam(): name not found: 'pgsql'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/salt/state.py", line 1933, in call
**cdata['kwargs'])
File "/usr/local/lib/python3.6/site-packages/salt/loader.py", line 1939, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/states/postgres_schema.py", line 75, in present
schema_attr = __salt__['postgres.schema_get'](dbname, name, **db_args)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 2107, in schema_get
db_password=db_password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 2162, in schema_list
password=db_password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 438, in psql_query
password=password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 377, in _psql_prepare_and_run
rcmd, runas=runas, password=password, host=host, port=port, user=user)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 186, in _run_psql
ret = __salt__['cmd.run_all'](cmd, python_shell=False, **kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 2069, in run_all
**kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 428, in _run
'User \'{0}\' is not available'.format(runas)
salt.exceptions.CommandExecutionError: User 'pgsql' is not available
Started: 19:40:05.540106
Duration: 19.641 ms
Changes:
----------
ID: postgres_schema-uuid-ossp
Function: postgres_schema.present
Name: uuid-ossp
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 425, in _run
pwd.getpwnam(runas)
KeyError: "getpwnam(): name not found: 'pgsql'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/salt/state.py", line 1933, in call
**cdata['kwargs'])
File "/usr/local/lib/python3.6/site-packages/salt/loader.py", line 1939, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/states/postgres_schema.py", line 75, in present
schema_attr = __salt__['postgres.schema_get'](dbname, name, **db_args)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 2107, in schema_get
db_password=db_password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 2162, in schema_list
password=db_password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 438, in psql_query
password=password)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 377, in _psql_prepare_and_run
rcmd, runas=runas, password=password, host=host, port=port, user=user)
File "/usr/local/lib/python3.6/site-packages/salt/modules/postgres.py", line 186, in _run_psql
ret = __salt__['cmd.run_all'](cmd, python_shell=False, **kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 2069, in run_all
**kwargs)
File "/usr/local/lib/python3.6/site-packages/salt/modules/cmdmod.py", line 428, in _run
'User \'{0}\' is not available'.format(runas)
salt.exceptions.CommandExecutionError: User 'pgsql' is not available
Started: 19:40:05.561178
Duration: 4.004 ms
Changes:
Summary for local
-------------
Succeeded: 20 (changed=16)
Failed: 2
-------------
Total states run: 22
Total run time: 47.954 s
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
After:
✔ Postgres service: should be running and enabled
✔ Service postgresql is expected to be enabled
✔ Service postgresql is expected to be running
✔ Port 5432 is expected to be listening
✔ Postgres configuration: should include the directory
✔ File /srv/my_tablespace is expected to be directory
✔ File /srv/my_tablespace is expected to be owned by "postgres"
✔ File /srv/my_tablespace is expected to be grouped into "postgres"
✔ File /srv/my_tablespace mode is expected to cmp == "0700"
✔ Postgres command: should match desired lines
✔ Command: `su - postgres -c 'psql -p5432 -qtc "\l+ db2"'` stdout is expected to match /db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space/
Profile Summary: 3 successful controls, 0 control failures, 0 controls skipped
Test Summary: 8 successful, 0 failures, 0 skipped
Documentation checklist
[ ] Updated the README (e.g. Available states).
[ ] Updated pillar.example.
Testing checklist
[ ] Included in Kitchen (i.e. under state_top).
[x] Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
#119:
user
wasn't available forpostgres_schema
in2017.7
and earlier (introduced in2018.3
):CC: @vutny.
Describe the changes you're proposing
Before:
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
After:
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context