Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Johnson <dave@ansibleworks.com>2016-07-21 17:31:46 +0300
committerGitHub <noreply@github.com>2016-07-21 17:31:46 +0300
commitdad53a9feb4400a9bad4f262a64bc4bbaf92ad9d (patch)
tree339b9b38b470f2f036487b6053ebdf59d0d92c6d /language_features
parentefa1eba776d955c250d57c70ee4bf3fb1b8647ae (diff)
parent036c3b81384ea9c01b3ba3809bf4c29ec405e83e (diff)
Merge pull request #143 from bbaassssiiee/master
ran ansible-lint: stripped trailing spaces
Diffstat (limited to 'language_features')
-rw-r--r--language_features/conditionals_part2.yml4
-rw-r--r--language_features/delegation.yml12
-rw-r--r--language_features/environment.yml4
-rw-r--r--language_features/eucalyptus-ec2.yml12
-rw-r--r--language_features/group_by.yml2
-rw-r--r--language_features/loop_plugins.yml2
-rw-r--r--language_features/prompts.yml6
-rw-r--r--language_features/register_logic.yml12
-rw-r--r--language_features/roletest.yml6
-rw-r--r--language_features/roletest2.yml6
-rw-r--r--language_features/upgraded_vars.yml2
11 files changed, 34 insertions, 34 deletions
diff --git a/language_features/conditionals_part2.yml b/language_features/conditionals_part2.yml
index abed3f0..332e88e 100644
--- a/language_features/conditionals_part2.yml
+++ b/language_features/conditionals_part2.yml
@@ -1,6 +1,6 @@
---
# this is a demo of conditional executions using 'when' statements, which can skip
-# certain tasks on machines/platforms/etc where they do not apply.
+# certain tasks on machines/platforms/etc where they do not apply.
- hosts: all
remote_user: root
@@ -28,7 +28,7 @@
- name: "do this if I have one of these SSNs"
shell: /bin/true
when: ssn in [ 8675309, 8675310, 8675311 ]
-
+
- name: "do this if a variable named hippo is NOT defined"
shell: /bin/true
when: hippo is not defined
diff --git a/language_features/delegation.yml b/language_features/delegation.yml
index 38b13ac..b2ad340 100644
--- a/language_features/delegation.yml
+++ b/language_features/delegation.yml
@@ -1,15 +1,15 @@
---
# this is an example of how we can perform actions on a given host on behalf of all the hosts
-# in a play.
+# in a play.
#
# The two main uses of this would be signalling an outage window for hosts that
# we are going to start upgrading, or to take a machine out of rotation by talking to a load
-# balancer.
+# balancer.
#
# This example cheats by replacing the load balancer script with the 'echo' command,
# leaving actual communication with the load balancer as an exercise to the reader. In reality,
-# you could call anything you want, the main thing is that it should do something with
+# you could call anything you want, the main thing is that it should do something with
# {{inventory_hostname}}
# NOTE: see batch_size_control.yml for an example of the 'serial' keyword, which you almost certainly
@@ -20,19 +20,19 @@
serial: 5
tasks:
-
+
- name: take the machine out of rotation
command: echo taking out of rotation {{inventory_hostname}}
delegate_to: 127.0.0.1
-# here's an alternate notation if you are delegating to 127.0.0.1, you can use 'local_action'
+# here's an alternate notation if you are delegating to 127.0.0.1, you can use 'local_action'
# instead of 'action' and leave off the 'delegate_to' part.
#
# - local_action: command echo taking out of rotation {{inventory_hostname}}
- name: do several things on the actual host
command: echo hi mom {{inventory_hostname}}
-
+
- name: put machine back into rotation
command: echo inserting into rotation {{inventory_hostname}}
delegate_to: 127.0.0.1
diff --git a/language_features/environment.yml b/language_features/environment.yml
index 16ffce9..0215794 100644
--- a/language_features/environment.yml
+++ b/language_features/environment.yml
@@ -12,7 +12,7 @@
# here we make a variable named "env" that is a dictionary
vars:
- env:
+ env:
HI: test2
http_proxy: http://proxy.example.com:8080
@@ -26,7 +26,7 @@
HI: test1
# here we are using the $env variable above
-
+
- shell: echo $HI
environment: env
diff --git a/language_features/eucalyptus-ec2.yml b/language_features/eucalyptus-ec2.yml
index 38b7e6f..f74b52f 100644
--- a/language_features/eucalyptus-ec2.yml
+++ b/language_features/eucalyptus-ec2.yml
@@ -1,12 +1,12 @@
---
# This playbook is an example for deploying multiple instances into
# EC2/Euca and "doing something" with them.
-#
+#
# - uses the ec2 and ec2_vol module.
#
# Run this with ansible-playbook and supply the private key for your
# EC2/Euca user (to access the instance in the second play), e.g:
-#
+#
# ansible-playbook eucalyptus-ec2-deploy.yml -v --private-key=/path/to/ec2/pri/key
#
@@ -26,12 +26,12 @@
# Launch 5 instances with the following parameters. Register the output.
tasks:
- - name: Launch instance
+ - name: Launch instance
ec2: keypair={{keypair}} group={{security_group}}
instance_type={{instance_type}} image={{image}}
- wait=true count=5
+ wait=true count=5
register: ec2
-
+
# Use with_items to add each instances public IP to a new hostgroup for use in the next play.
- name: Add new instances to host group
@@ -60,6 +60,6 @@
tasks:
- name: Ensure NTP is up and running
service: name=ntpd state=started
-
+
- name: Install Apache Web Server
yum: pkg=httpd state=latest
diff --git a/language_features/group_by.yml b/language_features/group_by.yml
index f90fb5a..c14305c 100644
--- a/language_features/group_by.yml
+++ b/language_features/group_by.yml
@@ -28,7 +28,7 @@
- hosts: CentOS-6.3
tasks:
-
+
- name: ping all CentOS 6.3 hosts
ping:
diff --git a/language_features/loop_plugins.yml b/language_features/loop_plugins.yml
index 0ea6395..65c3e3c 100644
--- a/language_features/loop_plugins.yml
+++ b/language_features/loop_plugins.yml
@@ -15,6 +15,6 @@
- file: dest=/etc/fooapp state=directory
- copy: src={{ item }} dest=/etc/fooapp/ owner=root mode=600
- with_fileglob: /playbooks/files/fooapp/*
+ with_fileglob: /playbooks/files/fooapp/*
diff --git a/language_features/prompts.yml b/language_features/prompts.yml
index 528d50c..e0ab95d 100644
--- a/language_features/prompts.yml
+++ b/language_features/prompts.yml
@@ -34,14 +34,14 @@
prompt: "Product release version"
default: "my_default_version"
private: no
-
+
- name: "my_password2"
prompt: "Enter password2"
private: yes
- encrypt: "md5_crypt"
+ encrypt: "md5_crypt"
confirm: yes
salt_size: 7
- salt: "foo"
+ salt: "foo"
# this is just a simple example to show that vars_prompt works, but
# you might ask for a tag to use with the git module or perhaps
diff --git a/language_features/register_logic.yml b/language_features/register_logic.yml
index e539991..f31c045 100644
--- a/language_features/register_logic.yml
+++ b/language_features/register_logic.yml
@@ -10,7 +10,7 @@
tasks:
# it is possible to save the result of any command in a named register. This variable will be made
- # available to tasks and templates made further down in the execution flow.
+ # available to tasks and templates made further down in the execution flow.
- shell: grep hi /etc/motd
ignore_errors: yes
@@ -18,7 +18,7 @@
# and here we access the register. Note that variable is structured data because
# it is a return from the command module. The shell module makes available variables such as
- # as 'stdout', 'stderr', and 'rc'.
+ # as 'stdout', 'stderr', and 'rc'.
# here we run the next action only if the previous grep returned true
@@ -29,17 +29,17 @@
- shell: echo "motd contains the word hi"
when: motd_result.stdout.find('hi') != -1
-
+
# or also:
-
+
- shell: echo "motd contains word hi"
when: "'hi' in motd_result.stdout"
-
+
# you can use 'stdout_lines' to loop over the registered output lines
- name: motd lines matching 'hi'
shell: echo "{{ item }}"
with_items: motd_result.stdout_lines
-
+
# you can also split 'stdout' yourself
- name: motd lines matching 'hi'
shell: echo "{{ item }}"
diff --git a/language_features/roletest.yml b/language_features/roletest.yml
index df2b25c..ba320ec 100644
--- a/language_features/roletest.yml
+++ b/language_features/roletest.yml
@@ -1,4 +1,4 @@
-# in Ansible 1.2 and later, roles allow easy best-practices organization of content
+# in Ansible 1.2 and later, roles allow easy best-practices organization of content
# and maximize shareability of ansible building blocks.
#
# suppose a playbook applied to a group of hosts includes two roles, foo and bar.
@@ -18,7 +18,7 @@
#
# templates and copy operations also get smarter about where to look for content when using
# roles.
-#
+#
# as an example, a task in foo/tasks/main.yml could copy or template a file by
# referencing a "src=foo.j2" rather than having to explicitly path src=roles/foo/templates/foo.j2.
@@ -35,7 +35,7 @@
roles:
- # a role can be listed flat like this:
+ # a role can be listed flat like this:
#
# - common
# - webservers
diff --git a/language_features/roletest2.yml b/language_features/roletest2.yml
index ffe0952..6042e86 100644
--- a/language_features/roletest2.yml
+++ b/language_features/roletest2.yml
@@ -1,4 +1,4 @@
-# in Ansible 1.2 and later, roles allow easy best-practices organization of content
+# in Ansible 1.2 and later, roles allow easy best-practices organization of content
# and maximize shareability of ansible building blocks.
#
# suppose a playbook applied to a group of hosts includes two roles, foo and bar.
@@ -18,7 +18,7 @@
#
# templates and copy operations also get smarter about where to look for content when using
# roles.
-#
+#
# as an example, a task in foo/tasks/main.yml could copy or template a file by
# referencing a "src=foo.j2" rather than having to explicitly path src=roles/foo/templates/foo.j2.
@@ -27,7 +27,7 @@
- hosts: all
roles:
- # a role can be listed flat like this:
+ # a role can be listed flat like this:
#
# - common
# - webservers
diff --git a/language_features/upgraded_vars.yml b/language_features/upgraded_vars.yml
index e9d6403..1e5ee69 100644
--- a/language_features/upgraded_vars.yml
+++ b/language_features/upgraded_vars.yml
@@ -6,7 +6,7 @@
vars:
a_list:
- - a
+ - a
- b
- c