Initial commit of UniFi controller ansible role
Change-Id: I53f5cbc07ab26655c76e015d74c22d2a2044f1dd
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml
new file mode 100644
index 0000000..afdb1c6
--- /dev/null
+++ b/molecule/default/converge.yml
@@ -0,0 +1,12 @@
+---
+# unifi molecule/default/verify.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Converge
+ hosts: all
+ tasks:
+ - name: "Include unifi"
+ include_role:
+ name: "unifi"
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
new file mode 100644
index 0000000..dfe579f
--- /dev/null
+++ b/molecule/default/molecule.yml
@@ -0,0 +1,20 @@
+---
+# unifi molecule/default/molecule.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+dependency:
+ name: galaxy
+driver:
+ name: docker
+platforms:
+ - name: "ubuntu-18.04-priv"
+ image: "quay.io/paulfantom/molecule-systemd:ubuntu-18.04"
+ privileged: true
+ volumes:
+ - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
+provisioner:
+ name: ansible
+verifier:
+ name: ansible
diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml
new file mode 100644
index 0000000..97f37af
--- /dev/null
+++ b/molecule/default/prepare.yml
@@ -0,0 +1,15 @@
+---
+# unifi molecule/default/prepare.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Prepare
+ hosts: all
+
+ tasks:
+ - name: Install GPG to support adding apt repo keys
+ apt:
+ name: "gpg"
+ state: "present"
+ update_cache: true
diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml
new file mode 100644
index 0000000..6fa1b62
--- /dev/null
+++ b/molecule/default/verify.yml
@@ -0,0 +1,20 @@
+---
+# unifi molecule/default/verify.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Verify
+ hosts: all
+ tasks:
+
+ # Redirect tests
+ - name: Check that unconfigured UniFi serves a 302 redirect to /setup
+ uri:
+ url: http://127.0.0.1:8080
+ headers:
+ follow_redirects: "none"
+ status_code: 302
+ return_content: true
+ register: webpage
+ failed_when: "webpage.location != 'http://127.0.0.1:8080/setup/'"