lxd_container: Create container via fingerprint (#52737)

In addition to using creating container using image
aliases, containers can also be created using
fingerprints, provided that the playbook author provide
alternate values for 'server', 'protocol' and swap out
'alias' for 'fingerprint'.

+label: docsite_pr
This commit is contained in:
Adam Chalkley 2019-04-17 13:35:48 -05:00 committed by Alicia Cozine
parent d7f6493084
commit 405c7b7ab3

View file

@ -181,6 +181,30 @@ EXAMPLES = '''
raw: apt-get install -y python
when: python_install_check.rc == 1
# An example for creating an Ubuntu 14.04 container using an image fingerprint.
# This requires changing 'server' and 'protocol' key values, replacing the
# 'alias' key with with 'fingerprint' and supplying an appropriate value that
# matches the container image you wish to use.
- hosts: localhost
connection: local
tasks:
- name: Create a started container
lxd_container:
name: mycontainer
state: started
source:
type: image
mode: pull
# Provides current (and older) Ubuntu images with listed fingerprints
server: https://cloud-images.ubuntu.com/releases
# Protocol used by 'ubuntu' remote (as shown by 'lxc remote list')
protocol: simplestreams
# This provides an Ubuntu 14.04 LTS amd64 image from 20150814.
fingerprint: e9a8bdfab6dc
profiles: ["default"]
wait_for_ipv4_addresses: true
timeout: 600
# An example for deleting a container
- hosts: localhost
connection: local