Package: ansible
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 7157
Maintainer: Ansible, Inc. <[email protected]>
Architecture: all
Version: 2.0.0.2-1ppa~trusty
Depends: python, python-support (>= 0.90), python-jinja2, python-yaml, python-paramiko, python-httplib2, python-six, python-crypto (>= 2.6), python-setuptools, sshpass
Conffiles:
/etc/ansible/hosts 1564b951dc7c8511c6f9ee842653c541
/etc/ansible/ansible.cfg 248f57c4cb0f11fe8fd5f39b12ac8205
Description: A radically simple IT automation platform
A radically simple IT automation platform that makes your applications and
systems easier to deploy. Avoid writing scripts or custom code to deploy and
update your applications— automate in a language that approaches plain English,
using SSH, with no agents to install on remote systems.
Homepage: http://ansible.github.com/
私の知る限り、何もありません。 他の方法で学んだら、これを更新します。
私は約1時間IRCを使用していて、エラーが発生する理由を解決しようとしています。
私のプレイブックには、変数名以外に何もありません。 これは清潔で新鮮な容器にあります。 私はpsql-U postgresをうまく実行できるので、これはansibleを備えたものでなければなりません。
- name: Install PostgreSQL and related packages
apt: name={{ item }} state=present update_cache=yes
with_items:
- postgresql
- postgresql-contrib
- python-psycopg2
- name: Create new database user
become_user: postgres
postgresql_user: name=apples role_attr_flags=SUPERUSER,CREATEROLE,CREATEDB,REPLICATION
データベースにアクセスしてユーザーを作成するため。
<postgres-dev.domain.com> ESTABLISH SSH CONNECTION FOR USER: root
<postgres-dev.domain.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/ansible-ssh-%h-%p-%r postgres-dev.domain.com 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python'
fatal: [postgres-dev.domain.com]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"db": "", "encrypted": false, "expires": null, "fail_on_user": true, "login_host": "", "login_password": "", "login_unix_socket": "", "login_user": "postgres", "name": "rooted", "no_password_changes": false, "password": null, "port": "5432", "priv": null, "role_attr_flags": "SUPERUSER,CREATEROLE,CREATEDB,REPLICATION", "state": "present", "user": "rooted"}, "module_name": "postgresql_user"}, "msg": "unable to connect to database: FATAL: Peer authentication failed for user \"postgres\"\n"}
これを読まなくてはいけないので、ごめんなさい。 become: yes
が足りませんでした
後世のために、新しいデータベースまたは新しいユーザーを作成する場合は、 postgres
ユーザーになる必要があります。 ルートとしてこれを実行しようとしましたが、エラーが発生し続けました。 以下の実例。
- name: make events database
postgresql_db:
name: events
become: true
become_user: postgres
- name: make www-data postgresql user
postgresql_user:
db: events
name: www-data
password: "{{ psql_password }}"
priv: ALL
become: true
become_user: postgres
Ansible 2.6.2を使用していますが、それでも機能しません
最も参考になるコメント
後世のために、新しいデータベースまたは新しいユーザーを作成する場合は、
postgres
ユーザーになる必要があります。 ルートとしてこれを実行しようとしましたが、エラーが発生し続けました。 以下の実例。