Antonio Pulido 2 năm trước cách đây
mục cha
commit
7975d90e2e
3 tập tin đã thay đổi với 30 bổ sung0 xóa
  1. 13 0
      T3/create_users.yml
  2. 7 0
      T3/print_facts.yml
  3. 10 0
      T3/print_ip.yml

+ 13 - 0
T3/create_users.yml

@@ -0,0 +1,13 @@
+---
+
+- name: create users from encrypted file
+  hosts: devservers
+  become: tru
+  remote_user: devops
+  vars_files:
+    - secret.yml
+  tasks:
+    - name:
+      user: creating user from secret.yml
+        name: "{{ username}"
+        password: "{{ password }}"

+ 7 - 0
T3/print_facts.yml

@@ -0,0 +1,7 @@
+---
+
+- name: Print all facts
+  hosts: all
+  tasks:
+    debug:
+      var: ansible_facts

+ 10 - 0
T3/print_ip.yml

@@ -0,0 +1,10 @@
+--- 
+
+- name: Print various facts
+  hosts: all
+  tasks:
+    - name: print IP
+      debug:
+        msg: >
+          The default IPV4 address of {{ ansible_facts.fqdn }}
+          is {{ ansible_facts.default_ipv4.address }}