remove cento8 testing for now
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f6da8d9e5d
commit
d5a78a348f
@ -111,7 +111,6 @@ local PipelineDocumentation = {
|
|||||||
},
|
},
|
||||||
depends_on: [
|
depends_on: [
|
||||||
'testing-centos7',
|
'testing-centos7',
|
||||||
'testing-centos8',
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -150,7 +149,6 @@ local PipelineNotification = {
|
|||||||
[
|
[
|
||||||
PipelineLinting,
|
PipelineLinting,
|
||||||
PipelineDeployment(scenario='centos7'),
|
PipelineDeployment(scenario='centos7'),
|
||||||
PipelineDeployment(scenario='centos8'),
|
|
||||||
PipelineDocumentation,
|
PipelineDocumentation,
|
||||||
PipelineNotification,
|
PipelineNotification,
|
||||||
]
|
]
|
||||||
|
37
.drone.yml
37
.drone.yml
@ -52,40 +52,6 @@ trigger:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- linting
|
- linting
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: testing-centos8
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
limit: 1
|
|
||||||
|
|
||||||
workspace:
|
|
||||||
base: /drone/src
|
|
||||||
path: ${DRONE_REPO_NAME}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: ansible-molecule
|
|
||||||
image: xoxys/molecule:3
|
|
||||||
commands:
|
|
||||||
- molecule test -scentos8
|
|
||||||
environment:
|
|
||||||
DO_API_KEY:
|
|
||||||
from_secret: do_api_key
|
|
||||||
MOLECULE_CUSTOM_FILTERS_REPO: https://gitea.rknet.org/ansible/custom_filters
|
|
||||||
MOLECULE_CUSTOM_MODULES_REPO: https://gitea.rknet.org/ansible/custom_modules
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- linting
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: documentation
|
name: documentation
|
||||||
@ -141,7 +107,6 @@ trigger:
|
|||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- testing-centos7
|
- testing-centos7
|
||||||
- testing-centos8
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -181,6 +146,6 @@ depends_on:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: f615aca12417b414015aa553be03a857737a82bdda0772d02674fbd6cf7f5e1b
|
hmac: c3eb21e904a1ceed464b6d86c674b7c0b6569ba1787b20cc716269ba7baf01b8
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
vars:
|
|
||||||
certbot_packages_extra:
|
|
||||||
- epel-release
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: xoxys.certbot
|
|
@ -1,87 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Create
|
|
||||||
hosts: localhost
|
|
||||||
connection: local
|
|
||||||
gather_facts: false
|
|
||||||
no_log: "{{ molecule_no_log }}"
|
|
||||||
vars:
|
|
||||||
ssh_user: root
|
|
||||||
ssh_port: 22
|
|
||||||
|
|
||||||
keypair_name: molecule_key
|
|
||||||
keypair_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/ssh_key"
|
|
||||||
tasks:
|
|
||||||
- name: Create local keypair
|
|
||||||
user:
|
|
||||||
name: "{{ lookup('env', 'USER') }}"
|
|
||||||
generate_ssh_key: true
|
|
||||||
ssh_key_file: "{{ keypair_path }}"
|
|
||||||
register: local_keypair
|
|
||||||
|
|
||||||
- name: Create remote keypair
|
|
||||||
digital_ocean_sshkey:
|
|
||||||
name: "{{ keypair_name }}"
|
|
||||||
ssh_pub_key: "{{ local_keypair.ssh_public_key }}"
|
|
||||||
state: present
|
|
||||||
register: remote_keypair
|
|
||||||
|
|
||||||
- name: Create molecule instance(s)
|
|
||||||
digital_ocean_droplet:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
unique_name: true
|
|
||||||
region: "{{ item.region_id }}"
|
|
||||||
image: "{{ item.image_id }}"
|
|
||||||
size: "{{ item.size_id }}"
|
|
||||||
ssh_keys: "{{ remote_keypair.data.ssh_key.id }}"
|
|
||||||
wait: true
|
|
||||||
wait_timeout: 300
|
|
||||||
state: present
|
|
||||||
register: server
|
|
||||||
loop: "{{ molecule_yml.platforms }}"
|
|
||||||
async: 7200
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Wait for instance(s) creation to complete
|
|
||||||
async_status:
|
|
||||||
jid: "{{ item.ansible_job_id }}"
|
|
||||||
register: digitalocean_jobs
|
|
||||||
until: digitalocean_jobs.finished
|
|
||||||
retries: 300
|
|
||||||
loop: "{{ server.results }}"
|
|
||||||
|
|
||||||
# Mandatory configuration for Molecule to function.
|
|
||||||
|
|
||||||
- name: Populate instance config dict
|
|
||||||
set_fact:
|
|
||||||
instance_conf_dict: {
|
|
||||||
'instance': "{{ item.data.droplet.name }}",
|
|
||||||
'address': "{{ item.data.ip_address }}",
|
|
||||||
'user': "{{ ssh_user }}",
|
|
||||||
'port': "{{ ssh_port }}",
|
|
||||||
'identity_file': "{{ keypair_path }}",
|
|
||||||
'droplet_id': "{{ item.data.droplet.id }}",
|
|
||||||
'ssh_key_id': "{{ remote_keypair.data.ssh_key.id }}",
|
|
||||||
}
|
|
||||||
loop: "{{ digitalocean_jobs.results }}"
|
|
||||||
register: instance_config_dict
|
|
||||||
when: server.changed | bool
|
|
||||||
|
|
||||||
- name: Convert instance config dict to a list
|
|
||||||
set_fact:
|
|
||||||
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
|
|
||||||
when: server.changed | bool
|
|
||||||
|
|
||||||
- name: Dump instance config
|
|
||||||
copy:
|
|
||||||
content: "{{ instance_conf | to_json | from_json | molecule_to_yaml | molecule_header }}"
|
|
||||||
dest: "{{ molecule_instance_config }}"
|
|
||||||
when: server.changed | bool
|
|
||||||
|
|
||||||
- name: Wait for SSH
|
|
||||||
wait_for:
|
|
||||||
port: "{{ ssh_port }}"
|
|
||||||
host: "{{ item.address }}"
|
|
||||||
search_regex: SSH
|
|
||||||
delay: 10
|
|
||||||
timeout: 320
|
|
||||||
loop: "{{ lookup('file', molecule_instance_config) | molecule_from_yaml }}"
|
|
@ -1 +0,0 @@
|
|||||||
default
|
|
@ -1,54 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Destroy
|
|
||||||
hosts: localhost
|
|
||||||
connection: local
|
|
||||||
gather_facts: false
|
|
||||||
no_log: "{{ molecule_no_log }}"
|
|
||||||
tasks:
|
|
||||||
- block:
|
|
||||||
- name: Populate instance config
|
|
||||||
set_fact:
|
|
||||||
instance_conf: "{{ lookup('file', molecule_instance_config) | molecule_from_yaml }}"
|
|
||||||
skip_instances: false
|
|
||||||
rescue:
|
|
||||||
- name: Populate instance config when file missing
|
|
||||||
set_fact:
|
|
||||||
instance_conf: {}
|
|
||||||
skip_instances: true
|
|
||||||
|
|
||||||
- name: Destroy molecule instance(s)
|
|
||||||
digital_ocean_droplet:
|
|
||||||
name: "{{ item.instance }}"
|
|
||||||
id: "{{ item.droplet_id }}"
|
|
||||||
state: absent
|
|
||||||
register: server
|
|
||||||
loop: "{{ instance_conf | flatten(levels=1) }}"
|
|
||||||
when: not skip_instances
|
|
||||||
async: 7200
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Wait for instance(s) deletion to complete
|
|
||||||
async_status:
|
|
||||||
jid: "{{ item.ansible_job_id }}"
|
|
||||||
register: digitalocean_jobs
|
|
||||||
until: digitalocean_jobs.finished
|
|
||||||
retries: 300
|
|
||||||
loop: "{{ server.results }}"
|
|
||||||
|
|
||||||
- name: Delete remote keypair
|
|
||||||
digital_ocean_sshkey:
|
|
||||||
fingerprint: "{{ item.ssh_key_id }}"
|
|
||||||
state: absent
|
|
||||||
loop: "{{ instance_conf | flatten(levels=1) }}"
|
|
||||||
|
|
||||||
# Mandatory configuration for Molecule to function.
|
|
||||||
|
|
||||||
- name: Populate instance config
|
|
||||||
set_fact:
|
|
||||||
instance_conf: {}
|
|
||||||
|
|
||||||
- name: Dump instance config
|
|
||||||
copy:
|
|
||||||
content: "{{ instance_conf | molecule_to_yaml | molecule_header }}"
|
|
||||||
dest: "{{ molecule_instance_config }}"
|
|
||||||
when: server.changed | bool
|
|
@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
driver:
|
|
||||||
name: delegated
|
|
||||||
platforms:
|
|
||||||
- name: centos7-certbot
|
|
||||||
region_id: fra1
|
|
||||||
image_id: centos-8-x64
|
|
||||||
size_id: s-1vcpu-1gb
|
|
||||||
lint: |
|
|
||||||
flake8
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
env:
|
|
||||||
ANSIBLE_FILTER_PLUGINS: ${ANSIBLE_FILTER_PLUGINS:-./plugins/filter}
|
|
||||||
ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-./library}
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Prepare
|
|
||||||
hosts: all
|
|
||||||
gather_facts: false
|
|
||||||
tasks:
|
|
||||||
- name: Install python for Ansible
|
|
||||||
raw: test -e /usr/bin/python || (dnf -y install python3 && alternatives --set python /usr/bin/python3)
|
|
||||||
become: true
|
|
||||||
changed_when: false
|
|
@ -1,14 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
import testinfra.utils.ansible_runner
|
|
||||||
|
|
||||||
import warnings
|
|
||||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
||||||
|
|
||||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|
||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
|
||||||
|
|
||||||
|
|
||||||
def test_certbot_is_installed(host):
|
|
||||||
certbot = host.package("certbot")
|
|
||||||
assert certbot.is_installed
|
|
@ -1 +1 @@
|
|||||||
centos8
|
centos7
|
Loading…
Reference in New Issue
Block a user