Change sudo to become in ansible resources
As we are using ansible 2.0, we should move from sudo to become to avoid deprecation. Change-Id: Ia084759b9c38f5c045ab14eab3af63a2ad33069f Closes-bug: 1547430
This commit is contained in:
parent
d5f7e90132
commit
e51ac240c3
@ -1,9 +1,9 @@
|
||||
- hosts: localhost
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
var1: 'playbook'
|
||||
roles:
|
||||
- { role: "test_role" }
|
||||
tasks:
|
||||
- debug: msg="VAR1 value is {{var1}}"
|
||||
- fail: msg='just test failure'
|
||||
- fail: msg='just test failure'
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
var1: initial
|
||||
uuid: stuff
|
||||
def1: the_same
|
||||
def1: the_same
|
||||
|
@ -1 +1 @@
|
||||
- debug: msg="Variable1 {{ var1 }} with uuid {{ uuid }} and default var {{ def1 }}"
|
||||
- debug: msg="Variable1 {{ var1 }} with uuid {{ uuid }} and default var {{ def1 }}"
|
||||
|
@ -1,6 +1,6 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
default1: playbook
|
||||
tasks:
|
||||
- debug: msg="my message {{default1}}"
|
||||
- debug: msg="my message {{default1}}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: rm -f {{item}}
|
||||
with_items:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- template:
|
||||
src: {{templates_dir}}/source
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
gather_facts: false
|
||||
# this is default variables, they will be overwritten by resource one
|
||||
vars:
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: echo `/sbin/ifconfig`
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: docker stop {{ resource_name }}
|
||||
- shell: docker rm {{ resource_name }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- docker:
|
||||
name: {{ resource_name }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- lineinfile: create=yes dest=/etc/dnsmasq.d/no_pxe_{{exclude_mac_pxe | replace(':', '_')}}.conf line="dhcp-host={{exclude_mac_pxe}},set:nopxe"
|
||||
|
@ -1,2 +1,2 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: docker --version
|
||||
ignore_errors: true
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: docker stop {{ resource_name }}
|
||||
- shell: docker rm {{ resource_name }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- docker:
|
||||
name: {{ resource_name }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- docker:
|
||||
name: {{ resource_name }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: glance api container
|
||||
docker:
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- docker:
|
||||
command: /bin/bash -c "glance-manage db_sync && /usr/bin/glance-api"
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: echo 'removed'
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
ip: {{ ip }}
|
||||
api_port: {{ api_port }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: glance registry container
|
||||
docker:
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- docker:
|
||||
#command: /bin/bash -c "glance-manage db_sync && /usr/bin/glance-registry"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# TODO
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path={{ config_dir.value['src'] }} state=absent
|
||||
|
@ -1,6 +1,6 @@
|
||||
# TODO
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
config_dir: {src: {{ config_dir['src'] }}, dst: {{ config_dir['dst'] }}}
|
||||
haproxy_ip: {{ ip }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# TODO
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
config_dir: {src: {{ config_dir['src'] }}, dst: {{ config_dir['dst'] }}}
|
||||
haproxy_ip: {{ ip }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- service:
|
||||
name: haproxy
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: haproxy
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: haproxy container
|
||||
docker:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: haproxy
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- service:
|
||||
name: haproxy
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Remove hosts file
|
||||
shell: echo '# flushed by ansible' > /etc/hosts
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
{% for val in hosts %}
|
||||
- name: Create hosts entries for {{val['name']}} => {{val['ip']}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
{% for val in hosts %}
|
||||
- name: Create hosts entries for {{val['name']}} => {{val['ip']}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path={{config_dir}} state=absent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
admin_token: {{admin_token}}
|
||||
keystone_host: {{ ip }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone role
|
||||
#TODO: not implemented in module
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install python-keystoneclient
|
||||
shell: apt-get install python-keystoneclient
|
||||
|
@ -1,6 +1,6 @@
|
||||
# TODO
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone container
|
||||
docker:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone container
|
||||
docker:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
ip: {{ip}}
|
||||
port: {{port}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone service and endpoint
|
||||
keystone_service:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone tenant
|
||||
keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} tenant={{tenant_name}} state=absent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install python-keystoneclient
|
||||
shell: apt-get install python-keystoneclient
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: keystone user
|
||||
#TODO: not implemented in module
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install python-keystoneclient
|
||||
shell: apt-get install python-keystoneclient
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path={{modules_path}} state=absent
|
||||
- file: path={{modules_path}}/../Puppetfile state=absent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
# XXX: check apt package http://packages.ubuntu.com/trusty/ruby/librarian-puppet
|
||||
- shell: gem install librarian-puppet --no-ri --no-rdoc
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
gather_facts: false
|
||||
# this is default variables, they will be overwritten by resource one
|
||||
vars:
|
||||
|
@ -1,6 +1,6 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
roles:
|
||||
- { role: "lxc_hosts", tags: [ "lxc-host", "host-setup" ] }
|
||||
post_tasks:
|
||||
- shell: pip install git+https://github.com/lxc/python2-lxc.git#egg=lxc
|
||||
- shell: pip install git+https://github.com/lxc/python2-lxc.git#egg=lxc
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: echo 'Managed by solar' > /etc/apt/sources.list
|
||||
when: {{ensure_other_removed}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb db
|
||||
mysql_db:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb db
|
||||
mysql_db:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb container
|
||||
docker:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path=/var/lib/docker/data/{{resource_name}} state=directory
|
||||
- name: mariadb container
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb user
|
||||
mysql_user:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb user
|
||||
mysql_user:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: mariadb user
|
||||
mysql_user:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [ {{ host }} ]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path=/root/openrc state=absent
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
tenant: {{tenant}}
|
||||
user_name: {{user_name}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- file: path={{config_dir}} state=absent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
admin_user: {{admin_user}}
|
||||
admin_password: {{admin_password}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- rabbitmq_user: user={{user_name}}
|
||||
vhost={{vhost_name}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- rabbitmq_user: user={{user_name}}
|
||||
password={{password}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- rabbitmq_vhost: name={{vhost_name}}
|
||||
state=absent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- rabbitmq_vhost: name={{vhost_name}}
|
||||
state=present
|
||||
|
@ -1,4 +1,4 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: riak-admin cluster join {{join_to}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
# - shell: sleep 30
|
||||
- shell: riak-admin cluster plan
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: riak-admin cluster join {{join_to}}
|
||||
ignore_errors: true
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: riak
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
# those below are mostly for tests
|
||||
- shell: killall -u riak
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- service:
|
||||
name: riak
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# TODO: this shouldn't be outside of the resource directory
|
||||
- hosts: all
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- script: /vagrant/bootstrap/playbooks/files/ubuntu-ansible.sh
|
||||
#- include: celery.yaml tags=['master'] celery_dir=/var/run/celery
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
gather_facts: false
|
||||
# this is default variables, they will be overwritten by resource one
|
||||
vars:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: pip install git+git://github.com/Mirantis/solar-agent.git
|
||||
- shell: start-stop-daemon --stop --make-pidfile --pidfile /tmp/solar_agent.pid --startas /bin/bash -- -c "exec /usr/local/bin/solar_agent run --port {{solar_agent_port}} --base tcp > /tmp/solar_agent.log 2>&1"
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- shell: pip install git+git://github.com/Mirantis/solar-agent.git
|
||||
- shell: start-stop-daemon --stop --make-pidfile --pidfile /tmp/solar_agent.pid --startas /bin/bash -- -c "exec /usr/local/bin/solar_agent run --port {{solar_agent_port}} --base tcp > /tmp/solar_agent.log 2>&1"
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: python-libtorrent
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: remove VG
|
||||
lvg: vg={{name}} state=absent force=yes
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install dependencies
|
||||
apt: name=lvm2 state=present
|
||||
|
@ -1,5 +1,5 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
become: yes
|
||||
vars:
|
||||
id: 42
|
||||
group: 239.1.10.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user