Hi, friends!
I am using ansible for provision my containers. It worked fine yesterday, but now it don’t. Please help me, what did happen?
It is my ansible task:
- name: Provision a containers
community.general.lxd_container:
name: "{{ item.name }}"
state: "{{ cp_provision_state }}"
config:
limits.cpu: "{{ item.cpu }}"
limits.memory: "{{ item.memory }}"
linux.kernel_modules:
security.privileged: "true"
security.nesting: "true"
user.network-config: |
version: 1
config:
- type: physical
name: eth0
subnets:
- type: static
ipv4: true
address: {{ item.ipaddress }}
netmask: {{ item.netmask }}
gateway: {{ item.gateway }}
control: auto
- type: nameserver
address: 62.4.49.131
- type: nameserver
address: 92.42.110.242
user.user-data: |
#cloud-config
packages:
- openssh-server
- sudo
runcmd:
- [ systemctl, daemon-reload ]
- [ systemctl, enable, sshd.service ]
- [ systemctl, start, --no-block, sshd.service ]
users:
- name: {{ item.user }}
lock_passwd: false
hashed_passwd: {{ item.hahed_password }}
sudo: [ "ALL=(ALL) NOPASSWD:ALL" ]
shell: /bin/bash
ssh-authorized-keys:
source:
type: image
mode: pull
server: https://images.linuxcontainers.org
protocol: lxd
fingerprint: 8cb6daf755ed
profiles: ["default", "kub-network-profile"]
timeout: 10
loop: "{{ cp_containers }}"
when I execute this task I getting this error:
msg": "Failed to fetch https://uk.images.linuxcontainers.org/1.0/images/8cb6daf755ed42890c82ad0a3e30d9f5f62625e373699ff4510914395994c948/export: 403 Forbidden
debug logs
DBUG[05-08|16:36:58] Connecting to a remote public LXD over HTTPs
DBUG[05-08|16:36:58] Sending request to LXD method=GET url=https://images.linuxcontainers.org/1.0 etag=
DBUG[05-08|16:36:58] Handling method=GET url=/1.0/operations/847aade4-fd02-450f-b0e1-896e54c76013/wait ip=@ username=root protocol=unix
DBUG[05-08|16:36:59] Got response struct from LXD
DBUG[05-08|16:36:59]
{
"config": null,
"api_extensions": null,
"api_status": "",
"api_version": "",
"auth": "guest",
"public": true,
"auth_methods": null,
"environment": {
"addresses": [
"images.linuxcontainers.org:8443"
],
"architectures": null,
"certificate": "",
"certificate_fingerprint": "",
"driver": "apache2",
"driver_version": "",
"firewall": "",
"kernel": "Linux",
"kernel_architecture": "x86_64",
"kernel_features": null,
"kernel_version": "",
"lxc_features": null,
"os_name": "",
"os_version": "",
"project": "",
"server": "images.linuxcontainers.org",
"server_clustered": false,
"server_name": "",
"server_pid": 0,
"server_version": "1.0",
"storage": "dir",
"storage_version": ""
}
}
DBUG[05-08|16:36:59] Sending request to LXD method=GET url=https://images.linuxcontainers.org/1.0/images/aliases/8cb6daf755ed etag=
DBUG[05-08|16:37:00] Sending request to LXD method=GET url=https://images.linuxcontainers.org/1.0/images/8cb6daf755ed etag=
DBUG[05-08|16:37:01] Got response struct from LXD
DBUG[05-08|16:37:01]
{
"auto_update": false,
"properties": {
"architecture": "amd64",
"build": "20210507_07:08",
"description": "Centos 7 amd64 (cloud) (20210507_07:08)",
"distribution": "centos",
"name": "centos-7-amd64-cloud-20210507_07:08",
"os": "centos",
"release": "7",
"serial": "20210507_07:08",
"variant": "cloud"
},
"public": true,
"expires_at": "1970-01-01T00:00:00Z",
"profiles": null,
"aliases": [
{
"name": "centos/7/amd64/cloud",
"description": "Centos 7 (amd64) (cloud)"
}
],
"architecture": "x86_64",
"cached": false,
"filename": "centos-7-amd64-cloud-20210507_07:08.tar.xz",
"fingerprint": "8cb6daf755ed42890c82ad0a3e30d9f5f62625e373699ff4510914395994c948",
"size": 94381646,
"type": "",
"created_at": "2021-05-08T02:16:47Z",
"last_used_at": "0001-01-01T00:00:00Z",
"uploaded_at": "2021-05-08T02:16:47Z"
}
DBUG[05-08|16:37:01] Database error: &errors.errorString{s:"No such object"}
DBUG[05-08|16:37:01] Database error: &errors.errorString{s:"No such object"}
INFO[05-08|16:37:01] Downloading image operation=847aade4-fd02-450f-b0e1-896e54c76013 alias=8cb6daf755ed server=https://images.linuxcontainers.org trigger=/1.0/operations/847aade4-fd02-450f-b0e1-896e54c76013 fingerprint=8cb6daf755ed42890c82ad0a3e30d9f5f62625e373699ff4510914395994c948
DBUG[05-08|16:37:02] Failure for task operation: 847aade4-fd02-450f-b0e1-896e54c76013: Failed to fetch https://uk.images.linuxcontainers.org/1.0/images/8cb6daf755ed42890c82ad0a3e30d9f5f62625e373699ff4510914395994c948/export: 403 Forbidden