Comments (7)
Which example you are talking about?
from ansible-examples.
I try this example:
ansible-examples/language_features/postgresql.yml
from ansible-examples.
@essanpupil post the full output, may help to figure out the issue.
from ansible-examples.
Sorry, i'm too busy with my other problems. So here is my complete output:
pupil@DreamRunner:~/ansible_training$ ansible-playbook install_config_postgre.yml -K
SUDO password:
PLAY [trustme] ****************************************************************
TASK: [ensure apt cache is up to date] ****************************************
ok: [trustme]
TASK: [ensure packages are installed] *****************************************
ok: [trustme] => (item=postgresql,libpq-dev,python-psycopg2)
PLAY [trustme] ****************************************************************
TASK: [ensure database is created] ********************************************
failed: [trustme] => {"failed": true}
msg: unable to connect to database: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/pupil/install_config_postgre.retry
trustme : ok=2 changed=0 unreachable=0 failed=1
and here is my .yml file
---
- hosts: trustme
sudo: yes
gather_facts: no
tasks:
- name: ensure apt cache is up to date
apt: update_cache=yes
- name: ensure packages are installed
apt: name={{item}}
with_items:
- postgresql
- libpq-dev
- python-psycopg2
- hosts: trustme
sudo: yes
sudo_user: postgres
gather_facts: no
vars:
dbname: scam_db
dbuser: django
dbpassword: katarahasia
tasks:
- name: ensure database is created
postgresql_db: name={{dbname}}
- name: ensure user has access to database
postgresql_user: db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
- name: ensure user does not have unnecessary privilege
postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
i hope this helps
from ansible-examples.
This happens to me as well, same symptoms, same versions.
from ansible-examples.
This happens to me too.
from ansible-examples.
To overcome this, I've added these two tasks to my roles which use Ubuntu 14.04, which seems to suffer from this problem.
- name: Locale patch for postgres
lineinfile: dest=/etc/default/locale line='LANGUAGE="en_US:en"' state=present
- name: Locale patch for postgres
lineinfile: dest=/etc/default/locale line='LC_ALL="en_US.UTF-8"' state=present
It's not .... ideal, but for my stuff it does the job. If done before installing postgresql via apt, it will install properly. I believe this is the problem described in full.
from ansible-examples.
Related Issues (20)
- set hostname to multiple hosts using ansible HOT 2
- The rabbitmq.yml example should also demonstrate installing the correct Erlang version
- task and role dir naming conventions
- Ansible for AWS HOT 4
- ansible-lint errors in wordpress-nginx/site.yml
- ios_config is not working in Ansible
- TASK [mongod : Start the mongodb service] ERROR HOT 1
- checking OSR(Operating system files) permission
- Registry settings required on all servers
- Test
- Add "best practices" example of separate staging/production inventories HOT 3
- SRE-Ansible To Install ELK Stack
- Inclusive language
- Wrong file name HOT 1
- Input parameters for the example playbooks are undocumented HOT 1
- Create a shell script that runs an ansible ad hac to create yum repository HOT 1
- no example of import_tasks or strategy HOT 1
- Ansible
- copy files from linux server to file shared on windows server HOT 1
- ansible-examples should adhere to the standards of the ansible-linter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-examples.