[BUG-FIX] Correct Vagrant-Ansible scripts bug. User sdn was not created.
Change-Id: Ia93444b998dec992e6703b2b410d579917044b7a
diff --git a/tools/dev/vagrant/ansible/onos-dev-clean.yml b/tools/dev/vagrant/ansible/onos-dev-clean.yml
index b134c32..8501293 100644
--- a/tools/dev/vagrant/ansible/onos-dev-clean.yml
+++ b/tools/dev/vagrant/ansible/onos-dev-clean.yml
@@ -1,6 +1,6 @@
---
#
-# Installs Java, configures ONOS bridges and LXC
+# Creates the user sdn, installs Java, configures ONOS bridges and LXC
#
- name: Include vars
hosts: localhost
@@ -11,6 +11,7 @@
remote_user: vagrant
serial: 1
roles:
+ - user-sdn
- brctl
- java8-oracle
- lxc
\ No newline at end of file
diff --git a/tools/dev/vagrant/ansible/roles/user-sdn/tasks/main.yml b/tools/dev/vagrant/ansible/roles/user-sdn/tasks/main.yml
new file mode 100644
index 0000000..a318630
--- /dev/null
+++ b/tools/dev/vagrant/ansible/roles/user-sdn/tasks/main.yml
@@ -0,0 +1,19 @@
+---
+#
+# Creates the user sdn with password rocks and makes it sudoer with no password required.
+#
+- name: Creating user sdn
+ user:
+ name: sdn
+ password: $6$rounds=656000$$tQyVAYDTqrDRTe2q6ZHKVmlBcd2rt0BYipETg85L2BHq.Hc8xJkj.qOyApnIqVt/mr2JGwbhx1nnL1d3mubYw0
+ generate_ssh_key: yes
+ ssh_key_bits: 2048
+ ssh_key_file: .ssh/id_rsa
+ shell: /bin/bash
+
+- name: Adding user sdn to sudoers with no password required
+ lineinfile:
+ dest: "/etc/sudoers.d/sdn"
+ line: "sdn ALL=(ALL) NOPASSWD:ALL"
+ state: present
+ create: yes
\ No newline at end of file