iuri-gg / ansible-role-yarn

Ansible Role - YARN Package Manager for Ubuntu/RHEL/CentOS https://galaxy.ansible.com/ocha/yarn/
26 stars 13 forks source link

Use HTTPS #5

Closed tangrufus closed 6 years ago

tangrufus commented 6 years ago

Use HTTPS as https://yarnpkg.com/lang/en/docs/install/ suggested

iuri-gg commented 6 years ago

Thank you for the PR @TangRufus. Looks like https source is not supported by docker image by default and https repo is not fetched during install. Can you please modify .travis.yml and install apt-transport-https. I think adding sudo apt-get install -y apt-transport-https in before_install sections should be good. This way PR should be green on CI and we can take it in

tangrufus commented 6 years ago

Looks like sudo apt-get install -y apt-transport-https is not enough. Any suggestion?

tangrufus commented 6 years ago

Tried both:

before_install:
  # Pull container from Docker Hub.
  - 'docker pull geerlingguy/docker-${distro}-ansible:latest'

  - sudo apt-get install -y apt-transport-https
install:
  # Create a random file to store the container ID.
  - container_id=$(mktemp)

  # Run container detached, with our role mounted inside.
  - 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'

  - if [[ "${distro}" == ubuntu* ]]; then docker exec "$(cat ${container_id})" apt-get -qq update; fi
  - if [[ "${distro}" == ubuntu* ]]; then docker exec "$(cat ${container_id})" apt-get install -y apt-transport-https; fi

No luck for both. Any suggestion?

iuri-gg commented 6 years ago

Im not sure. I am going to create a branch and experiment there. Usually when I see https repo not working while http works, it is because of apt missing https support... However it might not be the case here