Ansible 模块postgresql_schema不支持从数据库对单个模式进行备份和还原



我试图从 Postgres 数据库备份和恢复单个模式,但使用以下 yml 文件出现以下错误 我也使用了模块postgresql_db,但出现错误。

fatal: [192.168.1.18]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (postgresql_schema) module: target Supported parameters include: ca_cert, cascade_drop, database, login_host, login_password, login_unix_socket, login_user, owner, port, schema, session_role, ssl_mode, state"}
---
- hosts: dbserver
become: true
gather_facts: yes
vars:
dbname: dbname
dbuser: dbuser
password: dbpassword
tasks:
- name: Schema backup
postgresql_schema:
name: dbname
schema: schema1
state: dump
target: /tmp/schema.sql.gz
login_user: "{{ dbuser }}"
login_password: "{{ password }}"

我已经使用postgresql_db模块进行单模式备份并且工作正常,公共是模式名称。

- name: Dump a single schema for an existing database
postgresql_db:
name: acme
state: dump
target: /tmp/acme.sql
target_opts: "-n public" 

最新更新