Browse Source

Add support for boto3_install_method: git

This brings the role inline with other windmill roles.

Change-Id: I18b1d386463f520d781711ce9fee2f3c2e8e6d81
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/89/724889/3
Paul Belanger 2 years ago
parent
commit
deb251b167
  1. 4
      .zuul.yaml
  2. 6
      defaults/main.yaml
  3. 26
      tasks/install/git.yaml
  4. 13
      tests/playbooks/run.yaml

4
.zuul.yaml

@ -25,8 +25,8 @@
- job:
name: ansible-role-boto3-src
parent: ansible-role-boto3-base
# vars:
# boto3_install_method: git
vars:
boto3_install_method: git
- job:
name: ansible-role-boto3-src-fedora-latest

6
defaults/main.yaml

@ -28,6 +28,12 @@ boto3_file_credentials_mode: 0640
boto3_file_credentials_owner: "{{ boto3_user_name }}"
boto3_file_credentials_src: root/.aws/credentials.j2
# tasks/install.yaml
boto3_git_dest: "{{ ansible_user_dir }}/src/github.com/boto/boto3"
boto3_git_uri: https://github.com/boto/boto3
boto3_git_version: master
# boto3_git_update:
boto3_install_method: pip
boto3_pip_name: boto3

26
tasks/install/git.yaml

@ -0,0 +1,26 @@
# Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Git clone boto3
git:
dest: "{{ boto3_git_dest }}"
repo: "{{ boto3_git_uri }}"
update: "{{ boto3_git_update|default(omit) }}"
version: "{{ boto3_git_version }}"
- name: Set boto3_pip_name to local git repo
set_fact:
boto3_pip_name: "file://{{ boto3_git_dest }}"
- include: pip.yaml

13
tests/playbooks/run.yaml

@ -34,3 +34,16 @@
- aws_credentials_file_stat.stat.pw_name == 'root'
- aws_credentials_file_stat.stat.gr_name == 'root'
- aws_credentials_file_stat.stat.mode == '0640'
- name: Register boto3_git_dest_stat
stat:
path: /home/zuul/src/github.com/boto/boto3
register: boto3_git_dest_stat
when: boto3_install_method == 'git'
- name: Assert boto3_git_dest tests
assert:
that:
- boto3_git_dest_stat.stat.exists
- boto3_git_dest_stat.stat.isdir
when: boto3_install_method == 'git'

Loading…
Cancel
Save