optional yum upgrade and yum_cron setup
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
7fab29d9df
commit
93fafd7b25
115
.drone.jsonnet
Normal file
115
.drone.jsonnet
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
local AnsibleVersions(version="latest", package="ansible") = {
|
||||||
|
name: "ansible-" + version,
|
||||||
|
image: "python:3.7",
|
||||||
|
pull: "always",
|
||||||
|
environment: {
|
||||||
|
PY_COLORS: 1
|
||||||
|
},
|
||||||
|
commands: [
|
||||||
|
"pip install " + package + " ansible-later~=0.2.0 -qq",
|
||||||
|
"git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy",
|
||||||
|
"ansible-later -c ~/policy/config.yml"
|
||||||
|
],
|
||||||
|
depends_on: [
|
||||||
|
"clone",
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
local PipelineLinting = {
|
||||||
|
kind: "pipeline",
|
||||||
|
name: "linting",
|
||||||
|
platform: {
|
||||||
|
os: "linux",
|
||||||
|
arch: "amd64",
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
AnsibleVersions(version="latest", package="ansible"),
|
||||||
|
AnsibleVersions(version="master", package="git+https://github.com/ansible/ansible.git@devel"),
|
||||||
|
],
|
||||||
|
trigger: {
|
||||||
|
ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
local PipelineDeployment = {
|
||||||
|
kind: "pipeline",
|
||||||
|
name: "deployment",
|
||||||
|
platform: {
|
||||||
|
os: "linux",
|
||||||
|
arch: "amd64",
|
||||||
|
},
|
||||||
|
workspace: {
|
||||||
|
base: "/drone/src",
|
||||||
|
path: "xoxys.nginx"
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
{
|
||||||
|
name: "molecule",
|
||||||
|
image: "xoxys/molecule:ec2-linux-amd64",
|
||||||
|
pull: "always",
|
||||||
|
environment: {
|
||||||
|
ANSIBLE_ROLES_PATH: "/drone/src",
|
||||||
|
AWS_ACCESS_KEY_ID: { "from_secret": "aws_access_key_id" },
|
||||||
|
AWS_SECRET_ACCESS_KEY: { "from_secret": "aws_secret_access_key" },
|
||||||
|
AWS_REGION: "eu-central-1",
|
||||||
|
MOLECULE_CUSTOM_MODULES_REPO: "https://gitea.rknet.org/ansible/custom_modules",
|
||||||
|
MOLECULE_CUSTOM_FILTERS_REPO: "https://gitea.rknet.org/ansible/custom_filters",
|
||||||
|
PY_COLORS: 1
|
||||||
|
},
|
||||||
|
commands: [
|
||||||
|
"/bin/bash /docker-entrypoint.sh",
|
||||||
|
"molecule create --scenario-name ec2-centos-7",
|
||||||
|
"molecule converge --scenario-name ec2-centos-7",
|
||||||
|
"molecule verify --scenario-name ec2-centos-7",
|
||||||
|
"molecule destroy --scenario-name ec2-centos-7",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
depends_on: [
|
||||||
|
"linting",
|
||||||
|
],
|
||||||
|
trigger: {
|
||||||
|
ref: ["refs/heads/master", "refs/tags/**"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
local PipelineNotifications = {
|
||||||
|
kind: "pipeline",
|
||||||
|
name: "notifications",
|
||||||
|
platform: {
|
||||||
|
os: "linux",
|
||||||
|
arch: "amd64",
|
||||||
|
},
|
||||||
|
clone: {
|
||||||
|
disable: true,
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
{
|
||||||
|
name: "matrix",
|
||||||
|
image: "plugins/matrix",
|
||||||
|
settings: {
|
||||||
|
homeserver: "https://matrix.rknet.org",
|
||||||
|
roomid: "MtidqQXWWAtQcByBhH:rknet.org",
|
||||||
|
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}",
|
||||||
|
username: { "from_secret": "matrix_username" },
|
||||||
|
password: { "from_secret": "matrix_password" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// depends_on: [
|
||||||
|
// "deployment",
|
||||||
|
// ],
|
||||||
|
depends_on: [
|
||||||
|
"linting",
|
||||||
|
],
|
||||||
|
trigger: {
|
||||||
|
status: [ "success", "failure" ],
|
||||||
|
ref: ["refs/heads/master", "refs/tags/**"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
PipelineLinting,
|
||||||
|
// PipelineDeployment,
|
||||||
|
PipelineNotifications,
|
||||||
|
]
|
68
.drone.yml
68
.drone.yml
@ -1,42 +1,78 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: linting
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ansible-latest
|
- name: ansible-latest
|
||||||
image: python:2.7
|
|
||||||
pull: always
|
pull: always
|
||||||
|
image: python:3.7
|
||||||
commands:
|
commands:
|
||||||
- pip install ansible ansible-later -q
|
- pip install ansible ansible-later~=0.2.0 -qq
|
||||||
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
||||||
- git ls-files *[^LICENSE,.md] | xargs ansible-later -c ~/policy/config.ini
|
- ansible-later -c ~/policy/config.yml
|
||||||
|
environment:
|
||||||
|
PY_COLORS: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- clone
|
- clone
|
||||||
|
|
||||||
- name: ansible-master
|
- name: ansible-master
|
||||||
image: python:2.7
|
|
||||||
pull: always
|
pull: always
|
||||||
|
image: python:3.7
|
||||||
commands:
|
commands:
|
||||||
- pip install ansible ansible-later -q
|
- "pip install git+https://github.com/ansible/ansible.git@devel ansible-later~=0.2.0 -qq"
|
||||||
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
||||||
- git ls-files *[^LICENSE,.md] | xargs ansible-later -c ~/policy/config.ini
|
- ansible-later -c ~/policy/config.yml
|
||||||
|
environment:
|
||||||
|
PY_COLORS: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- clone
|
- clone
|
||||||
|
|
||||||
- name: notify
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- "refs/tags/**"
|
||||||
|
- "refs/pull/**"
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: notifications
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: matrix
|
||||||
image: plugins/matrix
|
image: plugins/matrix
|
||||||
settings:
|
settings:
|
||||||
homeserver: https://matrix.rknet.org
|
homeserver: https://matrix.rknet.org
|
||||||
|
password:
|
||||||
|
from_secret: matrix_password
|
||||||
roomid: MtidqQXWWAtQcByBhH:rknet.org
|
roomid: MtidqQXWWAtQcByBhH:rknet.org
|
||||||
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
||||||
username:
|
username:
|
||||||
from_secret: matrix_username
|
from_secret: matrix_username
|
||||||
password:
|
|
||||||
from_secret: matrix_password
|
trigger:
|
||||||
depends_on:
|
ref:
|
||||||
- ansible-latest
|
- refs/heads/master
|
||||||
- ansible-master
|
- "refs/tags/**"
|
||||||
when:
|
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
- failure
|
- failure
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- linting
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: signature
|
||||||
|
hmac: 3b9b4bcbe58abbeab7b6d8562aa6b062ae884a3341eeca35c56bf4b1cfa408ae
|
||||||
|
|
||||||
|
...
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
yum_cron_enabled: False
|
||||||
yum_cron_custom_cronjob: False
|
yum_cron_custom_cronjob: False
|
||||||
yum_cron_apply_updates: no
|
yum_cron_apply_updates: no
|
||||||
yum_cron_download_updates: yes
|
yum_cron_download_updates: yes
|
||||||
@ -14,6 +15,7 @@ yum_cron_emit_via: stdio
|
|||||||
# gpgkey: "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever/"
|
# gpgkey: "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever/"
|
||||||
# enabled: True
|
# enabled: True
|
||||||
|
|
||||||
|
yum_upgrade_enabled: False
|
||||||
yum_packages_install: []
|
yum_packages_install: []
|
||||||
yum_packages_uninstall: []
|
yum_packages_uninstall: []
|
||||||
yum_packages_extra_install: []
|
yum_packages_extra_install: []
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
listen: __yum_upgrade
|
listen: __yum_upgrade
|
||||||
|
when: yum_upgrade_enabled | bool
|
||||||
|
|
||||||
- name: Restart yum-cron
|
- name: Restart yum-cron
|
||||||
service:
|
service:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: yum_cron.yml
|
- include_tasks: yum_cron.yml
|
||||||
|
when: yum_cron_enabled | bool
|
||||||
- include_tasks: repository.yml
|
- include_tasks: repository.yml
|
||||||
- include_tasks: packages.yml
|
- include_tasks: packages.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user