Hi Marko,
Thank you for taking time to help me out, i updated the with_items locally,
like below
- name: Install the mysql packages in Redhat derivatives
yum: name={{ item }} state=installed
with_items:
- python-selinux
- mysql-server
- python-mysqldb
when: ansible_os_family == 'RedHat'
now i am getting
[ansible@centos1 playbooks]$ ansible-playbook mysql_server.yml -C
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [mysql : Add the OS specific variables]
***********************************
ok: [localhost]
TASK [mysql : Install the mysql packages in Redhat derivatives]
****************
failed: [localhost] (item=[u'python-selinux', u'mysql-server',
u'python-mysqldb']) => {"changed": false, "failed": true, "item":
["python-selinux", "mysql-server", "python-mysqldb"], "msg": "No package
matching 'python-selinux' found available, installed or updated", "rc":
126, "results": ["No package matching 'python-selinux' found available,
installed or updated"]}
to retry, use: --limit
@/home/ansible/ansible/playbooks/mysql_server.retry
PLAY RECAP
*********************************************************************
localhost : ok=2 changed=0 unreachable=0
failed=1
[ansible@centos1 playbooks]$
Do i need to add any repo for yum ?
On Thursday, February 2, 2017 at 12:35:09 PM UTC-5, jithendra myla wrote:
>
> Hello Sir/madam,
>
> I downloaded the ansible galaxy roles using ansible-galaxy install
> bennojoy.mysql from https://galaxy.ansible.com/bennojoy/mysql/ ,
> when i run it as below i get below error
>
> [ansible@centos1 playbooks]$ pwd
> /home/ansible/ansible/playbooks
> [ansible@centos1 playbooks]$ ls -ltr
> -rw-rw-r--. 1 ansible ansible 148 Feb 2 12:14 mysql_server.yml
> drwxrwxr-x. 8 ansible ansible 102 Feb 2 12:19 mysql
> -rw-rw-r--. 1 ansible ansible 10 Feb 2 12:20 mysql_server.retry
> [ansible@centos1 playbooks]$ ansible-playbook mysql_server.yml -C
>
> PLAY [localhost]
> ***************************************************************
>
> TASK [setup]
> *******************************************************************
> ok: [localhost]
>
> TASK [mysql : Add the OS specific variables]
> ***********************************
> ok: [localhost]
>
> TASK [mysql : Install the mysql packages in Redhat derivatives]
> ****************
> failed: [localhost] (item=[u'mysql_pkgs']) => {"changed": false, "failed":
> true, "item": ["mysql_pkgs"], "msg": "No package matching 'mysql_pkgs'
> found available, installed or updated", "rc": 126, "results": ["No package
> matching 'mysql_pkgs' found available, installed or updated"]}
> to retry, use: --limit
> @/home/ansible/ansible/playbooks/mysql_server.retry
>
> PLAY RECAP
> *********************************************************************
> localhost : ok=2 changed=0 unreachable=0
> failed=1
>
> [ansible@centos1 playbooks]$
> [ansible@centos1 playbooks]$ cat mysql_server.yml
> ---
> - hosts: localhost
> roles:
> - {role: mysql, mysql_db: [{name: sql_first_db}], mysql_users: [{name:
> sql1, pass: papa123, priv: "*.*:ALL"}] }
> [ansible@centos1 playbooks]$
>
> [ansible@centos1 playbooks]$ cat mysql/vars/RedHat.yml
> ---
> mysql_pkgs:
> - libselinux-python
> - mysql-server
> - MySQL-python
>
> mysql_service: mysqld
>
> mysql_conf_dir: "/etc/"
> [ansible@centos1 playbooks]$
>
>
> not sure defining a variable like above works, Can you please help me out
>
> Thank you very much for helping me
>
> -Jithendra Myla
>
>
>
>
>
>
>
--
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/876996d7-2b42-4fb1-b0a1-08e52a78ba5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.