Johannes,
 
       Thanks for getting back to me quickly. Please find my playbook steps

- name: PostgreSQL | Add PostgreSQL repository apt-key
  apt_key:
    id:         "{{ postgresql_apt_key_id }}"
    url:        "{{ postgresql_apt_key_url }}"
    state:      present
  register: key_result

- name: PostgreSQL | Add PostgreSQL repository
  apt_repository:
    repo:       "{{ postgresql_apt_repository }}"
    state:      present
    update_cache: true
    filename:   "postgres"
  when: key_result.changed
  register: repoadd

- name: PostgreSQL | Add PostgreSQL repository preferences
  template:
    src:        "pgdg.pref.j2"
    dest:       
"/etc/apt/preferences.d/apt_postgresql_org_pub_repos_apt.pref"
    backup:     yes

- name: PostgreSQL | Make sure the dependencies are installed
  apt:
    name:               "{{ item }}"
    state:              present
    update_cache:       true
  with_items:   ['python-psycopg2', 'python-pycurl', 'locales', 'sysstat', 
'libpq5']

- name: PostgreSQL | Install PostgreSQL
  apt:
    name:               "{{ item }}"
    state:              present
    update_cache:       true
  environment:          "{{ postgresql_env }}"
  when: repoadd.changed
  with_items:
    - "postgresql-common"
    - "postgresql-{{ postgresql_version }}"
    - "postgresql-client-{{ postgresql_version }}"
    - "postgresql-contrib-{{ postgresql_version }}"


Thanks
Shyam



On Friday, January 27, 2017 at 2:22:25 PM UTC-5, Johannes Kastl wrote:
>
> On 27.01.17 17:53 Shyam Yenna wrote: 
> > I am trying to install PostgreSQL 9.5 version on Ubuntu 14.04 LTS 
> > using ansible 2.2.1 version playbook tasks. According to my 
> > workflow design  add apt key, add apt repository and later install 
> > postgresql packages. But dependencies packages are broken due to 
> > version difference. How to overcome this issue i am unable to find 
> > below packages in default os packages. I appreciate your help. 
>
> Please show the exact playbook and the actual error messages. 
>
> Did you add the update_cache option to the apt installation task? 
>
> Johannes 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0aeae964-c5c6-4729-b40a-7ea24618a8cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to