Rename roles according to ansible recommendations
This commit is contained in:
parent
ce37f81e76
commit
bc5eda7487
17 changed files with 8 additions and 8 deletions
26
google_chrome/files/google-chrome-incognito.sh
Executable file
26
google_chrome/files/google-chrome-incognito.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
URL="${2-}"
|
||||
|
||||
CHROME="$(which google-chrome 2>/dev/null)"
|
||||
if [ -z "$CHROME" ]; then
|
||||
if [ -f "/Applications/Google Chrome.app" ]; then
|
||||
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||
else
|
||||
echo "ERR: Failed to find Google Chrome installation"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CHROMEDIR="$(mktemp -d)"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -rf ${CHROMEDIR}" EXIT
|
||||
|
||||
"$CHROME" \
|
||||
--incognito \
|
||||
--no-default-browser-check \
|
||||
--no-first-run \
|
||||
--user-data-dir="$CHROMEDIR" \
|
||||
"$URL"
|
33
google_chrome/files/google-chrome-socksproxy.sh
Executable file
33
google_chrome/files/google-chrome-socksproxy.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $(basename "$0") <PORT> [URL]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOCKSPORT="$1"
|
||||
URL="${2-}"
|
||||
|
||||
CHROME="$(which google-chrome 2>/dev/null)"
|
||||
if [ -z "$CHROME" ]; then
|
||||
if [ -f "/Applications/Google Chrome.app" ]; then
|
||||
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||
else
|
||||
echo "ERR: Failed to find Google Chrome installation"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CHROMEDIR="$(mktemp -d)"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -rf ${CHROMEDIR}" EXIT
|
||||
|
||||
"$CHROME" \
|
||||
--incognito \
|
||||
--no-default-browser-check \
|
||||
--no-first-run \
|
||||
--user-data-dir="$CHROMEDIR" \
|
||||
--proxy-server="socks5://localhost:${SOCKSPORT}" \
|
||||
"$URL"
|
6
google_chrome/files/managed.json
Normal file
6
google_chrome/files/managed.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"AuthServerWhitelist": "*.foo.sh",
|
||||
"AuthNegotiateDelegateWhitelist": "*.foo.sh",
|
||||
"HomepageLocation": "https://www.foo.sh",
|
||||
"PasswordManagerEnabled": false
|
||||
}
|
4
google_chrome/files/recommended.json
Normal file
4
google_chrome/files/recommended.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"RestoreOnStartup": 1,
|
||||
"ImportHistory": false
|
||||
}
|
52
google_chrome/tasks/main.yml
Normal file
52
google_chrome/tasks/main.yml
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
- name: enable google chrome repository
|
||||
yum_repository:
|
||||
name: google-chrome
|
||||
baseurl: http://dl.google.com/linux/chrome/rpm/stable/x86_64
|
||||
description: Google Chrome
|
||||
gpgcheck: true
|
||||
gpgkey: https://dl.google.com/linux/linux_signing_key.pub
|
||||
enabled: true
|
||||
|
||||
- name: "install google chrome"
|
||||
package:
|
||||
name: google-chrome-stable
|
||||
state: present
|
||||
|
||||
- name: "create google chrome policy directories"
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- /etc/opt/chrome/policies/managed
|
||||
- /etc/opt/chrome/policies/recommended
|
||||
|
||||
- name: "install google chrome managed settings"
|
||||
copy:
|
||||
dest: /etc/opt/chrome/policies/managed/foo.sh.json
|
||||
src: managed.json
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: "install google chrome recommended settings"
|
||||
copy:
|
||||
dest: /etc/opt/chrome/policies/recommended/foo.sh.json
|
||||
src: recommended.json
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: install custom chrome startup scripts
|
||||
copy:
|
||||
dest: "/usr/local/bin/{{ item }}"
|
||||
src: "{{ item }}.sh"
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
with_items:
|
||||
- google-chrome-incognito
|
||||
- google-chrome-socksproxy
|
Loading…
Add table
Add a link
Reference in a new issue