Skip to content

Commit

Permalink
chore: remove acme dags
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-foucault committed May 11, 2022
1 parent 1011889 commit facc868
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions dags/cas_cif_dags.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from dag_configuration import default_dag_args
from trigger_k8s_cronjob import trigger_k8s_cronjob
from reload_nginx_containers import reload_nginx_containers
from walg_backups import create_backup_task
from airflow.operators.python_operator import PythonOperator
from datetime import datetime, timedelta
from airflow import DAG
Expand All @@ -14,9 +12,6 @@
TWO_DAYS_AGO = datetime.now() - timedelta(days=2)

DEPLOY_DB_DAG_NAME = 'cas_cif_deploy_db'
CERT_RENEWAL_DAG_NAME = 'cas_cif_acme_renewal'
CERT_ISSUE_DAG_NAME = 'cas_cif_acme_issue'
BACKUP_DAG_NAME = 'cas_cif_backup'

cif_namespace = os.getenv('CIF_NAMESPACE')

Expand Down Expand Up @@ -57,52 +52,3 @@


cif_db_init >> cif_app_schema >> cif_import_operator

"""
###############################################################################
# #
# DAG triggering the cas-cif-acme-renewal cron job #
# #
###############################################################################
"""
SCHEDULE_INTERVAL = '0 8 * * *'

acme_renewal_args = {
**default_dag_args,
'start_date': TWO_DAYS_AGO,
'is_paused_upon_creation': False
}

"""
DAG cas_cif_issue
Issues site certificates for the cif app
"""
acme_issue_dag = DAG(CERT_ISSUE_DAG_NAME,
schedule_interval=None, default_args=acme_renewal_args)

cron_acme_issue_task = PythonOperator(
python_callable=trigger_k8s_cronjob,
task_id='cas_cif_cert_issue',
op_args=['cas-cif-acme-issue', cif_namespace],
dag=acme_issue_dag)

"""
DAG cas_cif_acme_renewal
Renews site certificates for the cif app
"""
acme_renewal_dag = DAG(CERT_RENEWAL_DAG_NAME, schedule_interval=SCHEDULE_INTERVAL,
default_args=acme_renewal_args, is_paused_upon_creation=True)

cert_renewal_task = PythonOperator(
python_callable=trigger_k8s_cronjob,
task_id='cas_cif_cert_renewal',
op_args=['cas-cif-acme-renewal', cif_namespace],
dag=acme_renewal_dag)

reload_nginx_task = PythonOperator(
python_callable=reload_nginx_containers,
task_id='cas_cif_reload_nginx',
op_args=['cas-cif', cif_namespace],
dag=acme_renewal_dag)

cert_renewal_task >> reload_nginx_task

0 comments on commit facc868

Please sign in to comment.