Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
'Type: Bugfix': ['fix/*', 'issue/*']
'Type: Build': build/*
'Type: CI': ['ci/*', 'travis/*', 'zuul/*']
'Type: Documentation': ['docs/*', 'doc/*', 'documentation/*']
'Type: Feature': ['feature/*', 'feat/*']
'Type: Maintenance': chore/*
'Type: Maintenance': ['chore/*', 'renovate/*']
'Type: Refactoring': ['refactor/*', 'refactoring/*']
'Type: Release': release/*
'Type: Style': style/*
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: PR labeler
on:
pull_request:
types: [opened]

jobs:
pr-labeler:
default:
runs-on: ubuntu-latest
steps:
- uses: technote-space/pr-labeler-action@v4
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Sync with master repository
---
name: Sync with generics repository

on:
schedule:
push:
paths:
- .github/workflows/sync-with-generics-repository.yml
schedule:
- cron: "0 0 * * *"
repository_dispatch:
types: [sync-with-master-repository]
types: [sync-with-generics-repository]

jobs:
sync-with-master-repository:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
Expand All @@ -20,9 +24,9 @@ jobs:
gilt overlay
gilt overlay
COMMIT_EMAIL: '[email protected]'
COMMIT_MESSAGE: 'chore: sync with master repository'
COMMIT_MESSAGE: 'chore: sync with generics repository'
COMMIT_NAME: 'GitHub Actions'
ONLY_DEFAULT_BRANCH: true
PR_BRANCH_NAME: 'sync-with-master-repository'
PR_BRANCH_NAME: 'sync-with-generics-repository'
PR_BRANCH_PREFIX: 'chore/'
PR_TITLE: 'chore: sync with master repository'
PR_TITLE: 'chore: sync with generics repository'
19 changes: 19 additions & 0 deletions .github/workflows/syntax-ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Check ansible syntax

on:
push:
paths:
- .github/workflows/syntax-ansible.yml
- '**.yml'
pull_request:
paths:
- .github/workflows/syntax-ansible.yml
- '**.yml'

jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ansible/ansible-lint-action@master
27 changes: 27 additions & 0 deletions .github/workflows/syntax-yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Check yaml syntax

on:
push:
paths:
- .github/workflows/syntax-yaml.yml
- '**.yml'
- '**.yaml'
pull_request:
paths:
- .github/workflows/syntax-yaml.yml
- '**.yml'
- '**.yaml'

jobs:
default:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: pip3 install yamllint
- run: yamllint --config-file .github/yamllint.yml .
5 changes: 5 additions & 0 deletions .github/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
extends: default

rules:
line-length: disable
10 changes: 9 additions & 1 deletion gilt.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
- git: https://github.com/osism/travis-master.git
- git: https://github.com/osism/generics.git
version: master
files:
- src: github/*.yml
dst: .github/
- src: github/workflows/*.yml
dst: .github/workflows/
- src: github/cleanup.sh
dst: scripts/cleanup-github.sh
- src: molecule/ansible.cfg
dst: molecule/default/ansible.cfg
- src: molecule/*.yml
Expand All @@ -12,6 +16,8 @@
dst: molecule/default/group_vars/
- src: ansible/*requirements.txt
dst: ./
- src: ansible/LICENSE
dst: ./
- src: ansible/gilt.yml
dst: ./
- src: ansible/tox.ini
Expand All @@ -35,3 +41,5 @@
- python3 scripts/render-template.py molecule/default/molecule.yml
- python3 scripts/render-template.py tox.ini
- rm -f scripts/render-template.py
- bash scripts/cleanup-github.sh
- rm -f scripts/cleanup-github.sh
20 changes: 9 additions & 11 deletions molecule/default/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
register: keypair

- name: Persist the keypair
copy:
copy: # noqa 503
dest: "{{ keypair_path }}"
content: "{{ keypair.key.private_key }}"
mode: 0600
Expand All @@ -62,9 +62,9 @@
key_name: "{{ keypair_name }}"
nics:
- net-name: "{{ nova.network_name }}"
config_drive: yes
delete_fip: yes
auto_ip: no
config_drive: true
delete_fip: true
auto_ip: false
timeout: 360
register: server
loop: "{{ molecule_yml.platforms }}"
Expand All @@ -84,7 +84,7 @@
cloud: molecule
server: "{{ item.name }}"
network: "{{ nova.floating_ip_pool }}"
wait: yes
wait: true
register: floating_ip
loop: "{{ molecule_yml.platforms }}"
async: 7200
Expand All @@ -101,26 +101,24 @@
# Mandatory configuration for molecule to function.

- name: Populate instance config dict
set_fact:
set_fact: # noqa 503
instance_conf_dict: {
'instance': "{{ item.0.openstack.name }}",
'address': "{{ item.1.floating_ip.floating_ip_address }}",
'user': "{{ ssh_user }}",
'port': "{{ ssh_port }}",
'identity_file': "{{ keypair_path }}"}
with_together:
- "{{ os_jobs_server.results }}"
- "{{ os_jobs_floating_ip.results }}"
loop: "{{ os_jobs_server.results|zip(os_jobs_floating_ip.results)|list }}"
register: instance_config_dict
when: server.changed | bool

- name: Convert instance config dict to a list
set_fact:
set_fact: # noqa 503
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
when: server.changed | bool

- name: Dump instance config
copy:
copy: # noqa 503
content: "{{ instance_conf | to_json | from_json | molecule_to_yaml | molecule_header }}"
dest: "{{ molecule_instance_config }}"
when: server.changed | bool
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
os_server:
cloud: molecule
name: "{{ item.name }}"
delete_fip: yes
delete_fip: true
state: absent
register: server
loop: "{{ molecule_yml.platforms }}"
Expand Down Expand Up @@ -44,7 +44,7 @@
instance_conf: {}

- name: Dump instance config
copy:
copy: # noqa 503
# NOTE(retr0h): Workaround for Ansible 2.2.
# https://github.com/ansible/ansible/issues/20885
content: "{{ instance_conf | to_json | from_json | molecule_to_yaml | molecule_header }}"
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
when: "ansible_distribution_release in ['xenial', 'bionic']"

- name: Create loopback device image
command: fallocate -l {{ device_size }} {{ device_file }} creates={{ device_file }}
command: "fallocate -l {{ device_size }} {{ device_file }} creates={{ device_file }}" # noqa 301

- name: Setup loopback device
command: losetup -P /dev/{{ device_name }} {{ device_file }}
command: "losetup -P /dev/{{ device_name }} {{ device_file }}" # noqa 301
become: true
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tox
tox==3.18.1
12 changes: 6 additions & 6 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ansible-lint
molecule-openstack
molecule>=3.0
openstacksdk
paramiko
testinfra
ansible-lint==4.2.0
molecule-openstack==0.1
molecule==3.0.6
openstacksdk==0.48.0
paramiko==2.7.1
testinfra==5.2.2