blob: 62ffbe2b29eee9aac7129f7a86e510c985883d5d [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
47- name: Force any restarts if necessary
Mohammed Naser511c3fa2022-03-17 17:54:10 -040048 ansible.builtin.meta: flush_handlers
Mohammed Naser336caf42022-03-11 17:56:45 -050049
50- name: Enable and start service
51 ansible.builtin.service:
52 name: containerd
53 enabled: true
54 state: started