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

Use local epel mirrorlist #142

Merged
merged 1 commit into from Sep 24, 2015
Merged

Use local epel mirrorlist #142

merged 1 commit into from Sep 24, 2015

Conversation

djgalloway
Copy link
Contributor

@ktdreyer
Copy link
Member

I didn't know you could put newlines in like that?

@djgalloway
Copy link
Contributor Author

Tested it on plana11. See [repository] OPTIONS section.

The other way to maintain this would be to create separate local files containing mirror URLs

epel_repos:
epel:
name: "Extra Packages for Enterprise Linux"
baseurl: "{{ epel_mirror_baseurl }}/{{ ansible_distribution_major_version }}/$basearch"
mirrorlist: "{{ epel_mirrorlist }}/metalink?repo=epel-{{ ansible_distribution_major_version }}&arch=$basearch"
baseurl: "{{ epel_mirror_baseurl }}/{{ ansible_distribution_major_version }}/$basearch\nhttp://mirrors.cat.pdx.edu/epel/{{ ansible_distribution_major_version }}/$basearch\nhttp://mirror.pnl.gov/epel/{{ ansible_distribution_major_version }}/$basearch\nhttp://fedora-epel.mirror.lstn.net/{{ ansible_distribution_major_version }}/$basearch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead have ansible manage a file, put that file on the remote and then point to it here in baseurl?

All this put into one string is difficult to parse, IMHO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, a separate file sounds a lot saner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A template might be useful here:
http://docs.ansible.com/ansible/template_module.html

@djgalloway
Copy link
Contributor Author

Suggestions on a cleaner way to do this are welcome

@@ -16,6 +16,12 @@
register: epel_repo
with_dict: epel_repos

- name: Configure local epel mirrorlists
template: src={{ item }} dest=/etc/yum.repos.d/{{ item }} owner=root group=root mode=0644
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I prefer this kind of formatting:

template:
  src: "{{ item }}"
  dest: "/etc/yum.repos.d/{{ item }}"
...

I think it's easier to read and makes for better diffs if/when we ever change this code.

@andrewschoen
Copy link
Contributor

All I had was a style nitpick, everything else here looks good to me.

Signed-off-by: dgalloway <dgallowa@REDHAT.COM>
zmc added a commit that referenced this pull request Sep 24, 2015
Use local epel mirrorlist
@zmc zmc merged commit 0968919 into master Sep 24, 2015
@zmc zmc deleted the wip-12739 branch September 24, 2015 21:12
@ktdreyer
Copy link
Member

thanks @djgalloway !

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

4 participants