Mohammed Naser | 336caf4 | 2022-03-11 17:56:45 -0500 | [diff] [blame] | 1 | # 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 |
| 31 | notify: |
| 32 | - Restart containerd |
| 33 | |
| 34 | - name: Update pause image in configuration |
| 35 | ansible.builtin.template: |
| 36 | src: config.toml.j2 |
| 37 | dest: /etc/containerd/config.toml |
| 38 | notify: |
| 39 | - Restart containerd |
| 40 | |
| 41 | - name: Force any restarts if necessary |
| 42 | meta: flush_handlers |
| 43 | |
| 44 | - name: Enable and start service |
| 45 | ansible.builtin.service: |
| 46 | name: containerd |
| 47 | enabled: true |
| 48 | state: started |