Skip to content

Commit

Permalink
Merge pull request #245 from skupjoe/master
Browse files Browse the repository at this point in the history
Fix #243
  • Loading branch information
jjethwa authored Oct 16, 2020
2 parents 8c94376 + dcb6a2a commit c55d26f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions content/opt/setup/50-icinga2
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,20 @@ chfn -f "${ICINGA2_USER_FULLNAME}" nagios
if [ "${ICINGA2_IDO_MYSQL_HOST}" == "localhost" ]; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGA2_IDO_MYSQL_DATA};
CREATE USER IF NOT EXISTS '${ICINGA2_IDO_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGA2_IDO_MYSQL_PASS}';
GRANT ALL
ON ${ICINGA2_IDO_MYSQL_DATA}.*
TO '${ICINGA2_IDO_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGA2_IDO_MYSQL_PASS}';
TO '${ICINGA2_IDO_MYSQL_USER}'@'localhost';
END
elif [ -n "${MYSQL_ROOT_PASSWORD:-}" ]; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGA2_IDO_MYSQL_DATA};
CREATE USER IF NOT EXISTS '${ICINGA2_IDO_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGA2_IDO_MYSQL_PASS}';
GRANT ALL
ON ${ICINGA2_IDO_MYSQL_DATA}.*
TO '${ICINGA2_IDO_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGA2_IDO_MYSQL_PASS}';
TO '${ICINGA2_IDO_MYSQL_USER}'@'%';
END
fi

Expand Down
10 changes: 6 additions & 4 deletions content/opt/setup/60-icingaweb2
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ if [ "${ICINGA2_IDO_MYSQL_HOST}" == "localhost" ]; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGAWEB2_MYSQL_DATA}
CHARACTER SET 'utf8';
CREATE USER IF NOT EXISTS '${ICINGAWEB2_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGAWEB2_MYSQL_PASS}';
GRANT ALL
ON ${ICINGAWEB2_MYSQL_DATA}.*
TO '${ICINGAWEB2_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGAWEB2_MYSQL_PASS}';
TO '${ICINGAWEB2_MYSQL_USER}'@'localhost';
END
elif [ -n "${MYSQL_ROOT_PASSWORD:-}" ]; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGAWEB2_MYSQL_DATA}
CHARACTER SET 'utf8';
CREATE USER IF NOT EXISTS '${ICINGAWEB2_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGAWEB2_MYSQL_PASS}';
GRANT ALL
ON ${ICINGAWEB2_MYSQL_DATA}.*
TO '${ICINGAWEB2_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGAWEB2_MYSQL_PASS}';
TO '${ICINGAWEB2_MYSQL_USER}'@'%';
END
fi

Expand Down
10 changes: 6 additions & 4 deletions content/opt/setup/61-icingaweb2-director
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ if evaluate_boolean "${ICINGA2_FEATURE_DIRECTOR}"; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGAWEB2_DIRECTOR_MYSQL_DATA}
CHARACTER SET 'utf8';
CREATE USER IF NOT EXISTS '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGAWEB2_DIRECTOR_MYSQL_PASS}';
GRANT ALL
ON ${ICINGAWEB2_DIRECTOR_MYSQL_DATA}.*
TO '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'localhost'
IDENTIFIED BY '${ICINGAWEB2_DIRECTOR_MYSQL_PASS}';
TO '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'localhost';
END
elif [ -n "${MYSQL_ROOT_PASSWORD:-}" ]; then
mysql_root <<-END
CREATE DATABASE IF NOT EXISTS ${ICINGAWEB2_DIRECTOR_MYSQL_DATA}
CHARACTER SET 'utf8';
CREATE USER IF NOT EXISTS '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGAWEB2_DIRECTOR_MYSQL_PASS}';
GRANT ALL
ON ${ICINGAWEB2_DIRECTOR_MYSQL_DATA}.*
TO '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'%'
IDENTIFIED BY '${ICINGAWEB2_DIRECTOR_MYSQL_PASS}';
TO '${ICINGAWEB2_DIRECTOR_MYSQL_USER}'@'%';
END
fi

Expand Down

0 comments on commit c55d26f

Please sign in to comment.