qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 3/4] Jobs based on custom runners: docs and gitlab-runner


From: Cleber Rosa
Subject: Re: [PATCH v4 3/4] Jobs based on custom runners: docs and gitlab-runner setup playbook
Date: Mon, 19 Oct 2020 16:54:50 -0400

On Mon, Oct 19, 2020 at 12:26:10PM +0200, Erik Skultety wrote:
> On Sun, Oct 18, 2020 at 09:50:02PM -0400, Cleber Rosa wrote:
> > +
> > +    - name: Checks the availability of official gitlab-runner builds in 
> > the archive
> > +      uri:
> > +        url: https://s3.amazonaws.com/gitlab-runner-downloads/v{{ 
> > gitlab_runner_version  }}/binaries/gitlab-runner-linux-386
> > +        method: HEAD
> > +        status_code:
> > +          - 200
> > +          - 403
> 
> Why is 403 an acceptable success status code?
>

I missed this question in my last reply, sorry.

s3 will throw a 403 if the URI doesn't exist... and we don't want to fail
the playbook because of that, given that we'll attempt the fallback
repo defined in vars.yml{,.template}.

> > +      register: gitlab_runner_available_archive
> > +
> > +    - name: Update base url
> > +      set_fact:
> > +        gitlab_runner_base_url: 
> > https://s3.amazonaws.com/gitlab-runner-downloads/v{{ gitlab_runner_version  
> > }}/binaries/gitlab-runner-
> > +      when: gitlab_runner_available_archive.status == 200
> > +    - debug:
> > +        msg: Base gitlab-runner url is {{ gitlab_runner_base_url  }}
> > +
> > +    - name: Set OS name (FreeBSD)
> > +      set_fact:
> > +        gitlab_runner_os: freebsd
> > +      when: "ansible_facts['system'] == 'FreeBSD'"
> > +
> > +    - name: Create a group for the gitlab-runner service
> > +      group:
> > +        name: gitlab-runner
> > +
> > +    - name: Create a user for the gitlab-runner service
> > +      user:
> > +        user: gitlab-runner
> > +        group: gitlab-runner
> > +        comment: GitLab Runner
> > +        home: /home/gitlab-runner
> > +        shell: /bin/bash
> > +
> > +    - name: Remove the .bash_logout file when on Ubuntu systems
> > +      file:
> > +        path: /home/gitlab-runner/.bash_logout
> > +        state: absent
> > +      when: "ansible_facts['distribution'] == 'Ubuntu'"
> > +
> > +    - name: Downloads the matching gitlab-runner
> > +      get_url:
> > +        dest: /usr/local/bin/gitlab-runner
> > +        url: "{{ gitlab_runner_base_url }}{{ gitlab_runner_os }}-{{ 
> > gitlab_runner_arch }}"
> > +        owner: gitlab-runner
> > +        group: gitlab-runner
> > +        mode: u=rwx,g=rwx,o=rx
> > +

Here, the actual download is performed, and no 40x is considered OK.
I hope that explains it.

Cheers,
- Cleber.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]