35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
---
|
|
- name: debian bootstrap fact gathering
|
|
hosts: all
|
|
user: root
|
|
gather_facts: False
|
|
|
|
# Install the basics required to gather facts.
|
|
# This shouldn't be run normally, however, can't find a way to
|
|
# conditionally run it so far.
|
|
tasks:
|
|
- name: update apt repository
|
|
action: raw apt-get -q -y update
|
|
|
|
- name: install python
|
|
action: raw apt-get -q -y install python
|
|
|
|
# the command succeeds (returns code 0) if python needs simplejson
|
|
- name: check if python is old enough to need simplejson
|
|
action: raw python -c 'import sys; sys.stdout.write("%s" % (sys.version_info<(2,6)))'
|
|
register: need_simplejson
|
|
|
|
- name: ensure other prereqs installed
|
|
action: raw apt-get -qy install python-simplejson
|
|
when: need_simplejson.stdout
|
|
|
|
- name: ensure other prereqs installed
|
|
action: raw apt-get -qy install python-paramiko python-yaml python-jinja2 python-apt python-docker
|
|
|
|
- name: update packages
|
|
tags:
|
|
- update
|
|
hosts: all
|
|
user: root
|
|
roles:
|
|
- role: apt-upgrade |