Skip to content

README.md example fixed and added include-as-task example #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,32 @@ ansible-galaxy install ANXS.postgresql

#### Example Playbook

Including an example of how to use your role:
An example how to include this role:

- hosts: postgresql-server
```yml
---
- hosts: postgresql-server
roles:
- role: ANXS.postgresql
become: yes
roles:
- { role: anxs.postgresql }
```

An example how to include this role as a task:

```yml
---
- hosts: postgresql-server
tasks:
- block: # workaround, see https://stackoverflow.com/a/56558842
- name: PSQL installation and configuration
include_role:
name: ANXS.postgresql
vars:
postgresql_users:
- name: abc
password: abc
become: true
```

#### Dependencies

Expand Down