From 845cc1a531610f2db9639393acc7c1663235716e Mon Sep 17 00:00:00 2001 From: Alfredo Solano Date: Mon, 17 Oct 2016 15:17:32 +0900 Subject: [PATCH] apt: doc: use yaml syntax in examples (#5070) --- packaging/os/apt.py | 102 +++++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/packaging/os/apt.py b/packaging/os/apt.py index 72709420e94..b58af6a7c4e 100644 --- a/packaging/os/apt.py +++ b/packaging/os/apt.py @@ -127,44 +127,70 @@ notes: ''' EXAMPLES = ''' -# Update repositories cache and install "foo" package -- apt: name=foo update_cache=yes - -# Remove "foo" package -- apt: name=foo state=absent - -# Install the package "foo" -- apt: name=foo state=present - -# Install the version '1.00' of package "foo" -- apt: name=foo=1.00 state=present - -# Update the repository cache and update package "nginx" to latest version using default release squeeze-backport -- apt: name=nginx state=latest default_release=squeeze-backports update_cache=yes - -# Install latest version of "openjdk-6-jdk" ignoring "install-recommends" -- apt: name=openjdk-6-jdk state=latest install_recommends=no - -# Update all packages to the latest version -- apt: upgrade=dist - -# Run the equivalent of "apt-get update" as a separate step -- apt: update_cache=yes - -# Only run "update_cache=yes" if the last one is more than 3600 seconds ago -- apt: update_cache=yes cache_valid_time=3600 - -# Pass options to dpkg on run -- apt: upgrade=dist update_cache=yes dpkg_options='force-confold,force-confdef' - -# Install a .deb package -- apt: deb=/tmp/mypackage.deb - -# Install the build dependencies for package "foo" -- apt: pkg=foo state=build-dep - -# Install a .deb package from the internet. -- apt: deb=https://example.com/python-ppq_0.1-1_all.deb +- name: Update repositories cache and install "foo" package + apt: + name: foo + update_cache: yes + +- name: Remove "foo" package + apt: + name: foo + state: absent + +- name: Install the package "foo" + apt: + name: foo + state: present + +- name: Install the version '1.00' of package "foo" + apt: + name: foo=1.00 + state: present + +- name: Update the repository cache and update package "nginx" to latest version using default release squeeze-backport + apt: + name: nginx + state: latest + default_release: squeeze-backports + update_cache: yes + +- name: Install latest version of "openjdk-6-jdk" ignoring "install-recommends" + apt: + name: openjdk-6-jdk + state: latest + install_recommends: no + +- name: Update all packages to the latest version + apt: + upgrade: dist + +- name: Run the equivalent of "apt-get update" as a separate step + apt: + update_cache: yes + +- name: Only run "update_cache=yes" if the last one is more than 3600 seconds ago + apt: + update_cache: yes + cache_valid_time: 3600 + +- name: Pass options to dpkg on run + apt: + upgrade: dist + update_cache: yes + dpkg_options: force-confold,force-confdef + +- name: Install a .deb package + apt: + deb: /tmp/mypackage.deb + +- name: Install the build dependencies for package "foo" + apt: + pkg: foo + state: build-dep + +- name: Install a .deb package from the internet. + apt: + deb: https://example.com/python-ppq_0.1-1_all.deb ''' RETURN = '''