Tadas Sutkaitis | 4ace418 | 2023-02-27 04:31:52 +0200 | [diff] [blame] | 1 | # Copyright (c) 2023 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: Verify |
| 16 | hosts: all |
| 17 | become: true |
| 18 | |
| 19 | pre_tasks: |
| 20 | - name: Gather service facts |
| 21 | service_facts: |
| 22 | |
| 23 | tasks: |
| 24 | - name: Make sure containerd service is running |
| 25 | ansible.builtin.assert: |
| 26 | that: |
| 27 | - ansible_facts.services['containerd.service'].state in ['active', 'running'] |
| 28 | |
| 29 | - name: Make sure containerd service is enabled |
| 30 | ansible.builtin.assert: |
| 31 | that: |
| 32 | - ansible_facts.services['containerd.service'].status == 'enabled' |
| 33 | |
| 34 | - name: Pull image from registry |
| 35 | ansible.builtin.command: ctr image pull docker.io/library/alpine:latest |
| 36 | |
| 37 | - name: List images |
| 38 | ansible.builtin.command: ctr images ls |
| 39 | register: images |
| 40 | failed_when: not(images.stdout.find('alpine') != -1) |