Adding a repo file before doing a yum install

20 views
Skip to first unread message

Nicholas Sheridan

unread,
May 9, 2017, 8:31:56 PM5/9/17
to Ansible Project
Hi forum **newbie alert**

I want to do this:
sudo vi /etc/yum.repos.d/kibana.repo

[kibana-4.4]
name=Kibana repository for 4.4.x packages
gpgcheck=1
enabled=1

sudo yum -y install kibana

So I think I would normally do this:

---
- hosts: servers
  sudo: yes
  tasks:
    - name: install kibana
      apt: name= kibana update_cache=yes state=latest

But I need to write the repo file first before I do a yum - can any one help with this?


Thanks!
Nik

Kai Stian Olstad

unread,
May 10, 2017, 6:53:32 AM5/10/17
to ansible...@googlegroups.com
You are talking about yum but uses the apt module, that should be yum I
presume.

You have all the modules here
https://docs.ansible.com/ansible/list_of_all_modules.html

and if you search for yum you'll find

yum_repository - Add or remove YUM repositories
https://docs.ansible.com/ansible/yum_repository_module.html

You can also find the documentation on the command line like this.

$ ansible-doc --list|grep yum
yum Manages packages with the `yum'
package manager
yum_repository Add or remove YUM repositories

To get the documentation on the yum_repository module
$ ansible-doc yum_repository

--
Kai Stian Olstad

Nicholas Sheridan

unread,
May 12, 2017, 4:07:30 AM5/12/17
to Ansible Project, ansible-pr...@olstad.com
Thanks Kai I'll check this out! 
Reply all
Reply to author
Forward
0 new messages