blob: 95b38e63bf60fce1fac200c939d8f9fa92e0e9ae [file] [log] [blame]
Mohammed Naser336caf42022-03-11 17:56:45 -05001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15- name: Add repository
16 ansible.builtin.apt_repository:
17 repo: "deb {{ containerd_repository_url }} {{ ansible_distribution_release }} main"
18 state: present
19 when:
20 - containerd_repository_url is defined
21
22- name: Install packages
23 ansible.builtin.apt:
24 name: containerd
25 state: present
26
27- name: Create folder for configuration
28 ansible.builtin.file:
29 path: /etc/containerd
30 state: directory
Mohammed Naser511c3fa2022-03-17 17:54:10 -040031 owner: root
32 group: root
33 mode: 0755
Mohammed Naser336caf42022-03-11 17:56:45 -050034 notify:
35 - Restart containerd
36
37- name: Update pause image in configuration
38 ansible.builtin.template:
39 src: config.toml.j2
40 dest: /etc/containerd/config.toml
Mohammed Naser511c3fa2022-03-17 17:54:10 -040041 owner: root
42 group: root
43 mode: 0644
Mohammed Naser336caf42022-03-11 17:56:45 -050044 notify:
45 - Restart containerd
46
Mohammed Naserff1980a2022-11-12 14:32:57 +000047- name: Bump DefaultLimitMEMLOCK for system
48 ansible.builtin.lineinfile:
49 path: /etc/systemd/system.conf
50 regexp: '^DefaultLimitMEMLOCK='
51 line: 'DefaultLimitMEMLOCK=infinity'
52 state: present
53 notify:
54 - Reload systemd
55 - Restart containerd
56
Mohammed Naser336caf42022-03-11 17:56:45 -050057- name: Force any restarts if necessary
Mohammed Naser511c3fa2022-03-17 17:54:10 -040058 ansible.builtin.meta: flush_handlers
Mohammed Naser336caf42022-03-11 17:56:45 -050059
60- name: Enable and start service
61 ansible.builtin.service:
62 name: containerd
63 enabled: true
64 state: started