lxd_container: Create container via fingerprint (#52737) (#55608)

Docs: adds example of creating a container using fingerprints, swapping out 'alias' for 'fingerprint' and adding alternate values for 'server' and 'protocol'.

(cherry picked from commit 405c7b7ab3)
This commit is contained in:
Alicia Cozine 2019-04-22 10:01:54 -05:00 committed by GitHub
parent 564393a5e0
commit a851a0db08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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