3

Running a salt state that looks like the following to create a postgres database for django...

django-db:
  postgres_database.present:
  - encoding: 'UTF-8'
  - owner: djangouser
  - db_user: postgres

When I run it the first time, so far, so good:

      ID: django-db
Function: postgres_database.present
  Result: True
 Comment: The database django-db has been created
 Started: 20:59:01.148225
Duration: 494.007 ms
 Changes:
          ----------
          django-db:
              Present

But when I run it again, the result is an error:

      ID: django-db
Function: postgres_database.present
  Result: False
 Comment: Database django-db has wrong parameters which couldn't be changed on fly.
 Started: 21:04:14.289538
Duration: 101.216 ms
 Changes:

1 Answer 1

2

Credit to user martin_ on IRC, The problem is the hyphen in 'UTF-8'. The state should be

django-db:
  postgres_database.present:
  - encoding: 'UTF8'
  - owner: djangouser
  - db_user: postgres

http://irclog.perlgeek.de/salt/2014-08-30/text

1
  • This is still valid in 2020 :)
    – moestly
    Jun 26, 2020 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .