Skip to content
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

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

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

europ
Copy link
Contributor

@europ europ commented Sep 30, 2020

  • fixed existing example how to include this role (fixed case)
    • become global scope changed to role-only
  • added new example how to include this role as task

* fixed existing example how to include this role (fixed case)
* added new example how to include this role as task
@maglub
Copy link
Collaborator

maglub commented Dec 6, 2020

The examples you propose does not need become: true, as that is dealt with inside the role already.

@europ
Copy link
Contributor Author

europ commented Feb 23, 2021

The become is truly necessary otherwise some tasks will fail. Your example does include the become as well.

PLAY [container] **************************************************************************************

TASK [Gathering Facts] ********************************************************************************
ok: [172.17.0.2]

TASK [ANXS.postgresql : include_vars] *****************************************************************
ok: [172.17.0.2] => (item=/home/username/.ansible/roles/ANXS.postgresql/vars/../vars/RedHat.yml)

TASK [ANXS.postgresql : PostgreSQL | Make sure the CA certificates are available | apt] ***************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Add PostgreSQL repository apt-key | apt] *************************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Add PostgreSQL repository | apt] *********************************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Add PostgreSQL repository preferences | apt] *********************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Make sure the dependencies are installed | apt] ******************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Install PostgreSQL | apt] ****************************************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | PGTune | apt] ****************************************************
skipping: [172.17.0.2]

TASK [ANXS.postgresql : PostgreSQL | Install all the required dependencies | yum] *********************
fatal: [172.17.0.2]: FAILED! => {"changed": false, "changes": {"installed": ["python-psycopg2","epel-re
lease", "libselinux-python"]}, "msg": "ovl: Error while doing RPMdb copy-up:\n[Errno 13] Permission den
ied: '/var/lib/rpm/Dirnames'\nYou need to be root to perform this command.\n", "rc": 1, "results": ["ca
-certificates-2020.2.41-70.0.el7_8.noarch providing ca-certificates is already installed", "python-pycu
rl-7.19.0-19.el7.x86_64 providing python-pycurl is already installed", "glibc-common-2.17-323.el7_9.x86
_64 providing glibc-common is already installed", "Loaded plugins: fastestmirror, ovl\n"]}

PLAY RECAP ********************************************************************************************
172.17.0.2      : ok=2    changed=0    unreachable=0    failed=1    skipped=7    rescued=0    ignored=0

I do not see any become: true near by tasks that are installing packages, e.g.:

- block:
- name: PostgreSQL | Install all the required dependencies | yum
yum:
name: ["ca-certificates","python-psycopg2", "python-pycurl", "glibc-common","epel-release","libselinux-python"]
state: present

@maglub
Copy link
Collaborator

maglub commented Feb 23, 2021

I agree now after reading through the role. The become: true statements in the role all have become_user: "{{postgresql_admin_user}}".

@maglub maglub merged commit 0bbc9f8 into ANXS:master Feb 23, 2021
@europ europ deleted the readme-fix branch March 7, 2021 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants