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

Ansible: mirror selection logic #15

Open
gnosthi opened this issue Jun 22, 2018 · 6 comments
Open

Ansible: mirror selection logic #15

gnosthi opened this issue Jun 22, 2018 · 6 comments
Assignees

Comments

@gnosthi
Copy link

gnosthi commented Jun 22, 2018

Ansible playbook fails on emerging gentoolkit due to name resolution errors.

Packer version: 1.1.3
Ansible version: 2.4.1.0
VirtualBox version: 5.2.2 r119230
ISO File: install-amd64-minimal-20180415T214502Z.iso

-- Error --
fatal: [/mnt/gentoo]: FAILED! => {"changed": true, "cmd": "emerge gentoolkit", "delta": "0:00:11.867978", "end": "2018-06-22 06:50:33.541086", "msg": "non-zero return code", "rc": 1, "start": "2018-06-22 06:50:21.673108", "stderr": "--- Invalid atom in /etc/portage/package.mask/system: >=sys-libs/glibc2.28\n--- Invalid atom in /etc/portage/package.mask/system: >=dev-lang/python3.6", "stderr_lines": ["--- Invalid atom in /etc/portage/package.mask/system: >=sys-libs/glibc2.28", "--- Invalid atom in /etc/portage/package.mask/system: >=dev-lang/python3.6"], "stdout": "Calculating dependencies \n * IMPORTANT: 12 news items need reading for repository 'gentoo'.\n * Use eselect news read to view new items.\n\n... done!\n\n>>> Verifying ebuild manifests\n\n>>> Emerging (1 of 1) app-portage/gentoolkit-0.4.2-r1::gentoo\n>>> Downloading 'http://gentoo.osuosl.org/distfiles/gentoolkit-0.4.2.tar.gz'\n--2018-06-22 06:50:23-- http://gentoo.osuosl.org/distfiles/gentoolkit-0.4.2.tar.gz\nResolving gentoo.osuosl.org... failed: Temporary failure in name resolution.\nwget: unable to resolve host address 'gentoo.osuosl.org'\n>>> Downloading 'https://dev.gentoo.org/~mgorny/dist/gentoolkit-0.4.2.tar.gz'\n--2018-06-22 06:50:33-- https://dev.gentoo.org/~mgorny/dist/gentoolkit-0.4.2.tar.gz\nResolving dev.gentoo.org... failed: Temporary failure in name resolution.\nwget: unable to resolve host address 'dev.gentoo.org'\n!!! Couldn't download 'gentoolkit-0.4.2.tar.gz'. Aborting.\n * Fetch failed for 'app-portage/gentoolkit-0.4.2-r1', Log file:\n * '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'\n\n>>> Failed to emerge app-portage/gentoolkit-0.4.2-r1, Log file:\n\n>>> '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'\n * Messages for package app-portage/gentoolkit-0.4.2-r1:\n * Fetch failed for 'app-portage/gentoolkit-0.4.2-r1', Log file:\n * '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'", "stdout_lines": ["Calculating dependencies ", " * IMPORTANT: 12 news items need reading for repository 'gentoo'.", " * Use eselect news read to view new items.", "", "... done!", "", ">>> Verifying ebuild manifests", "", ">>> Emerging (1 of 1) app-portage/gentoolkit-0.4.2-r1::gentoo", ">>> Downloading 'http://gentoo.osuosl.org/distfiles/gentoolkit-0.4.2.tar.gz'", "--2018-06-22 06:50:23-- http://gentoo.osuosl.org/distfiles/gentoolkit-0.4.2.tar.gz", "Resolving gentoo.osuosl.org... failed: Temporary failure in name resolution.", "wget: unable to resolve host address 'gentoo.osuosl.org'", ">>> Downloading 'https://dev.gentoo.org/~mgorny/dist/gentoolkit-0.4.2.tar.gz'", "--2018-06-22 06:50:33-- https://dev.gentoo.org/~mgorny/dist/gentoolkit-0.4.2.tar.gz", "Resolving dev.gentoo.org... failed: Temporary failure in name resolution.", "wget: unable to resolve host address 'dev.gentoo.org'", "!!! Couldn't download 'gentoolkit-0.4.2.tar.gz'. Aborting.", " * Fetch failed for 'app-portage/gentoolkit-0.4.2-r1', Log file:", " * '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'", "", ">>> Failed to emerge app-portage/gentoolkit-0.4.2-r1, Log file:", "", ">>> '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'", " * Messages for package app-portage/gentoolkit-0.4.2-r1:", " * Fetch failed for 'app-portage/gentoolkit-0.4.2-r1', Log file:", " * '/var/tmp/portage/app-portage/gentoolkit-0.4.2-r1/temp/build.log'"]}
virtualbox-iso: to retry, use: --limit @/tmp/packer-provisioner-ansible-local/5b2ce016-9d33-ec0f-4784-4069843978a0/chroot.retry

@dyindude
Copy link
Owner

gentoo_mirror defaults to http://gentoo.osuosl.org in ansible/roles/handbook-02-stage3/defaults/main.yml

If you're having issues reaching that mirror, I'd recommend trying to pass another value for gentoo_mirror either

  • via a command line argument: -e gentoo_mirror="$MIRROR"
  • modifying the playbook to include vars

I was thinking about trying to do some mirror selection logic before running the playbook instead of hard-coding the value. It might be possible to choose a mirror by merging mirrorselect into the live environment and setting gentoo_mirror to the result.

@dyindude dyindude self-assigned this Jun 22, 2018
@dyindude dyindude changed the title Failure on Ansible Play - Unable to resolve hosts Ansible: mirror selection logic Jun 22, 2018
@dyindude
Copy link
Owner

if we sync via git/github, this becomes much less of a problem #11

@dyindude
Copy link
Owner

or does it? that only affects the portage ebuild mirror, not the mirror used to download packages, right? 👎

@dyindude
Copy link
Owner

perhaps we can be smart about it, and only rely on defaults/mirrorselect if a user-provided mirror is not present

@dyindude
Copy link
Owner

mirrorselect can be ran from the livecd, which means it never needs to be installed on the resulting system (though it may be nice to have if we want it to run on the vagrant image)

@dyindude
Copy link
Owner

example:

mirrorselect -s3 -b10 -c USA -o
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Limiting test to "country=USA" hosts. 
* Downloading a list of mirrors...
 Got 133 mirrors.
Using netselect to choose the top3 hosts, in blocks of 10. 2 of 2 blocks complete.te.

GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants