Ansible MySQL module issue

48 views
Skip to first unread message

shiva jawanjal

unread,
May 4, 2017, 11:15:02 AM5/4/17
to Ansible Project
I am trying to use ansible role for MySQL 
When I am running MySQL role, I am not able to get pass installation even though the packages are installed. 

######################
TASK [ansible-role-mysql : include] ********************************************
included: /var/lib/jenkins/workspace/openmarket-ansible/roles/external/ansible-role-mysql/tasks/setup-RedHat.yml for 192.168.3.123

TASK [ansible-role-mysql : Ensure MySQL packages are installed.] ***************
failed: [192.168.3.123] (item=[u'mariadb', u'mariadb-server', u'mariadb-libs', u'MySQL-python', u'perl-DBD-MySQL']) => {"changed": true, "failed": true, "item": ["mariadb", "mariadb-server", "mariadb-libs", "MySQL-python", "perl-DBD-MySQL"], "msg": "You need to be root to perform this command.\n", "rc": 1, "results": ["mariadb-1:5.5.52-1.el7.x86_64 providing mariadb is already installed", "mariadb-libs-1:5.5.52-1.el7.x86_64 providing mariadb-libs is already installed", "Loaded plugins: fastestmirror\n"]}
	to retry, use: --limit @/var/lib/jenkins/workspace/openmarket-ansible/plays/build.retry

PLAY RECAP *********************************************************************
192.168.3.123              : ok=12   changed=0    unreachable=0    failed=1   

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
	at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:226)
	at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:199)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
	at hudson.model.Run.execute(Run.java:1728)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:405)
ERROR: Ansible playbook execution failed
Finished: FAILURE
#######################

My inventory file is as follows:
[mysql]
192.168.3.123  ansible_connection=ssh ansible_user=devops ansible_ssh_private_key_file=devops.priv

And Playbook file is:
- hosts: mysql
  connection : ssh
  remote_user : devops
  become_method : sudo
  become: yes
  gather_facts : yes
  roles:
    - { role: ansible-role-mysql,                    tags: ["ansible-role-mysql"] }
#########
Note: 'devops' user has sudo access & passowrdless sudo setup already.


Dick Visser

unread,
May 4, 2017, 12:26:17 PM5/4/17
to ansible...@googlegroups.com
Looks like your sudo setup isn't right.
What does the sudo entry look like?


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c2b781f4-cb88-4e6e-915e-02a1f79a8dc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs
Reply all
Reply to author
Forward
0 new messages