Skip to content

Commit

Permalink
Use sudo for installing docker (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgijssel authored Jun 1, 2023
1 parent 411de0a commit 10eae82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions provisioner/deploys/docker/tasks/install_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def install_docker():
packages=["curl", "ca-certificates", "gnupg"],
update=True,
cache_time=24 * 60 * 60,
_sudo=True,
)

server.shell(
Expand All @@ -42,6 +43,7 @@ def install_docker():
"deb [arch={arch} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/{distro} {version_codename} stable"
).format(arch=arch, distro=distro, version_codename=version_codename),
filename="docker-ce-stable",
_sudo=True,
)

apt.packages(
Expand All @@ -55,6 +57,7 @@ def install_docker():
],
update=True,
cache_time=0 if add_apt_repo.changed else 24 * 60 * 60,
_sudo=True,
)

existing_groups = host.get_fact(Users)["ubuntu"]["groups"]
Expand Down
4 changes: 2 additions & 2 deletions provisioner/deploys/monitoring/tasks/install_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def install_monitoring():
_sudo=True,
)

apt.repo(
add_apt_repo = apt.repo(
name="Install New Relic repo",
src=f"deb https://download.newrelic.com/infrastructure_agent/linux/apt/ {version_codename} main",
filename="newrelic-infra",
Expand All @@ -94,7 +94,7 @@ def install_monitoring():
packages=["newrelic-infra"],
update=True,
present=True,
cache_time=24 * 60 * 60,
cache_time=0 if add_apt_repo.changed else 24 * 60 * 60,
_sudo=True,
)

Expand Down

0 comments on commit 10eae82

Please sign in to comment.