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 μ ν μ μμΌλ―λ‘ μ΄κ²μ κ°λ₯ν κ²μ΄μ΄μΌν©λλ€.
- 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
μ(λ₯Ό) λλ½νμ΅λλ€.
νμμ μν΄ μ db λλ μ μ¬μ©μλ₯Ό λ§λλ κ²½μ° 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λ₯Ό μ¬μ©νκ³ μλλ° μ¬μ ν μλνμ§ μμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
νμμ μν΄ μ db λλ μ μ¬μ©μλ₯Ό λ§λλ κ²½μ°
postgres
μ¬μ©μκ° λμ΄μΌ ν©λλ€. μ΄ μμ μ 루νΈλ‘ μλνλλ° κ³μ μ€λ₯κ° λ°μνμ΅λλ€. μλ μμ μ.