Advertisement
Guest User

Untitled

a guest
Oct 10th, 2013
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.43 KB | None | 0 0
  1. ---
  2. -
  3.   hosts: localhost
  4.   connection: local
  5.   vars:
  6.     nullvar: null
  7.     nullarr:
  8.      - null
  9.     nullindirectarr:
  10.       - pw: null
  11.     rootpw: test
  12.   tasks:
  13.     - name: Create mysql database
  14.       mysql_db:
  15.         login_user: root
  16.         login_password: "{{ rootpw }}"
  17.         name: test
  18.     - name: Create mysql user with pw abc
  19.       mysql_user:
  20.         login_user: root
  21.         login_password: "{{ rootpw }}"
  22.         password: abc
  23.         name: user1
  24.         priv: "test.*:ALL"
  25.         host: localhost
  26.     - name: Change priv only. Dont change pw.
  27.       mysql_user:
  28.         login_user: root
  29.         login_password: "{{ rootpw }}"
  30.         password: null
  31.         name: user1
  32.         priv: "*.*:ALL"
  33.         host: localhost
  34.     - name: is pw still the same? Green yes, orange no (is green)
  35.       mysql_user:
  36.         login_user: root
  37.         login_password: "{{ rootpw }}"
  38.         password: abc
  39.         name: user1
  40.         host: localhost
  41.     - name: Doesnt change a thing
  42.       mysql_user:
  43.         login_user: root
  44.         login_password: "{{ rootpw }}"
  45.         password: null
  46.         name: user1
  47.         priv: "*.*:ALL"
  48.         host: localhost
  49.     - name: is pw still the same? Green yes, orange no (is green)
  50.       mysql_user:
  51.         login_user: root
  52.         login_password: "{{ rootpw }}"
  53.         password: abc
  54.         name: user1
  55.         host: localhost
  56.     - name: Shouldnt change a thing but does
  57.       mysql_user:
  58.         login_user: root
  59.         login_password: "{{ rootpw }}"
  60.         password: "{{ nullvar }}"
  61.         #password: nullvar #Doesnt' work...
  62.         #password: $nullvar #Doesnt' work...
  63.         name: user1
  64.         priv: "*.*:ALL"
  65.         host: localhost
  66.     - name: is pw still the same? Green yes, orange no (is orange)
  67.       mysql_user:
  68.         login_user: root
  69.         login_password: "{{ rootpw }}"
  70.         password: abc
  71.         name: user1
  72.         host: localhost
  73.     - name: With_items does show that its null but still doesnt work
  74.       mysql_user:
  75.         login_user: root
  76.         login_password: "{{ rootpw }}"
  77.         password: "{{ item.pw }}"
  78.         name: user1
  79.         priv: "*.*:ALL"
  80.         host: localhost
  81.       with_items: nullindirectarr
  82.     - name: is pw still the same? Green yes, orange no (is orange)
  83.       mysql_user:
  84.         login_user: root
  85.         login_password: "{{ rootpw }}"
  86.         password: abc
  87.         name: user1
  88.         host: localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement