From bdf58f4c9c69b091f648044505f0a0f9bef1f024 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Mon, 4 Jan 2021 09:13:39 -0700 Subject: [PATCH] additional configs --- defaults/main.yml | 1 + files/00-limit.conf | 2 ++ files/kojid.service | 17 +++++++++++++++ handlers/main.yml | 4 ++++ tasks/config.yml | 42 ++++++++++++++++++++++++++++++++++++- templates/koji.conf.j2 | 15 +++++++++++++ templates/site-defaults.cfg | 10 +++++++++ 7 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 files/00-limit.conf create mode 100644 files/kojid.service create mode 100644 templates/koji.conf.j2 create mode 100644 templates/site-defaults.cfg diff --git a/defaults/main.yml b/defaults/main.yml index f17458d..bfda119 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,6 +36,7 @@ kojid_ca_bundle: /etc/pki/tls/certs/ca-bundle.crt kojid_keytab: /etc/kojid.keytab kojid_smtp_host: smtp.rockylinux.org kojid_allowed_scm: "git.centos.org:/* git.rockylinux.org:/*" +kojid_bugzilla: https://bugs.rockylinux.org kojid_maxjobs: 20 kojid_minspace: 8192 diff --git a/files/00-limit.conf b/files/00-limit.conf new file mode 100644 index 0000000..c304256 --- /dev/null +++ b/files/00-limit.conf @@ -0,0 +1,2 @@ +# +* - nofile 4096 diff --git a/files/kojid.service b/files/kojid.service new file mode 100644 index 0000000..45e7307 --- /dev/null +++ b/files/kojid.service @@ -0,0 +1,17 @@ +[Unit] +Description=Koji build server +Documentation=https://docs.pagure.org/koji/server_howto/ + +After=network.target + +[Service] +TasksMax=infinity +Restart=on-failure +ExecStart=/usr/sbin/kojid \ + --fg \ + --force-lock \ + --verbose +ExecReload=/bin/kill -USR1 $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/handlers/main.yml b/handlers/main.yml index a652739..8a3add4 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,3 +4,7 @@ service: name: kojid state: restarted + +- name: reload_systemd + systemd: + daemon_reload: true diff --git a/tasks/config.yml b/tasks/config.yml index 1c3a418..138dda7 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,7 +1,25 @@ --- # kojid configuration -# oz +# sysctl and limits +- name: set highmem_is_dirtyable on armv7 builders if applicable + sysctl: + name: vm.highmem_is_dirtyable + value: 1 + state: present + sysctl_set: true + reload: true + when: ansible_architecture == 'armv7l' + +- name: Set nofile limit to 4096 + copy: + src: 00-limit.conf + dest: /etc/security/limits.d/00-limit.conf + owner: root + group: root + mode: '0644' + +# oz and plugins - name: OZ Config template: src: oz.cfg.j2 @@ -20,6 +38,16 @@ mode: '0644' notify: restart_kojid +# kojid base configuration +- name: Configure koji.conf + template: + src: koji.conf.j2 + dest: /etc/koji.conf + owner: root + group: root + mode: '0644' + notify: restart_kojid + - name: Configure kojid template: src: kojid.conf.j2 @@ -28,3 +56,15 @@ group: root mode: '0644' notify: restart_kojid + +# systemd override +- name: Override kojid.service + copy: + src: kojid.service + dest: /etc/systemd/system/kojid.service + owner: root + group: root + mode: '0644' + notify: + - reload_systemd + - restart_kojid diff --git a/templates/koji.conf.j2 b/templates/koji.conf.j2 new file mode 100644 index 0000000..fd8868b --- /dev/null +++ b/templates/koji.conf.j2 @@ -0,0 +1,15 @@ +[koji] +;url of XMLRPC server +server = {{ kojid_hub_url }} + +;url of web interface +weburl = {{ kojid_web_url }} + +;url of package download site +topurl = {{ kojid_files_url }} + +;path to the koji top directory +topdir = {{ kojid_mount }} + +; https ca, not for ssl auth +serverca = {{ kojid_ca_bundle }} diff --git a/templates/site-defaults.cfg b/templates/site-defaults.cfg new file mode 100644 index 0000000..5a23b03 --- /dev/null +++ b/templates/site-defaults.cfg @@ -0,0 +1,10 @@ +config_opts['plugin_conf']['package_state_enable'] = False +config_opts['plugin_conf']['ccache_enable'] = False +config_opts['dnf_common_opts'] = ['--setopt=install_weak_deps=0'] +config_opts['macros']['%bugurl'] = '{{ kojid_bugzilla }}' +config_opts['nosync'] = True +config_opts['nosync_force'] = True +config_opts['environment']['LANG'] = 'C.UTF-8' +config_opts['use_bootstrap'] = True +config_opts['yum_install_command'] += " -x devtoolset*" +config_opts['dnf_warning'] = False