"become" is the correct ansible keyword for priv escalation in newer
versions. So use that.
This will fix at least the ansible-playbook setup.yml call which
previously failed.
Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
- hosts: localhost
user: jenkins-build
- sudo: True
+ become: True
tasks:
- include: tasks/postgresql.yml
- name: update apt cache
apt:
update_cache: yes
- sudo: yes
+ become: yes
- name: set postgresql version on trusty
set_fact:
when: ansible_distribution_release == "xenial"
- name: install postgresql requirements
- sudo: yes
+ become: yes
apt:
name: "{{ item }}"
state: present
name: postgresql
state: started
enabled: yes
- sudo: yes
+ become: yes
- name: allow users to connect locally
- sudo: yes
+ become: yes
lineinfile:
dest: "/etc/postgresql/{{ postgresql_version }}/main/pg_hba.conf"
# allow all ipv4 local connections without a password
- service:
name: postgresql
state: restarted
- sudo: true
+ become: true