Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puppetpublic
base
Commits
3aef7387
Commit
3aef7387
authored
8 years ago
by
Adam Lewenberg
Browse files
Options
Downloads
Patches
Plain Diff
first attempt at apt cache file override
parent
92f08cda
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/os/debian.pp
+44
-2
44 additions, 2 deletions
manifests/os/debian.pp
templates/os/etc/apt/preferences.d/apt_cache_tmp.erb
+1
-0
1 addition, 0 deletions
templates/os/etc/apt/preferences.d/apt_cache_tmp.erb
with
45 additions
and
2 deletions
manifests/os/debian.pp
+
44
−
2
View file @
3aef7387
...
@@ -7,7 +7,33 @@
...
@@ -7,7 +7,33 @@
# We install filter-syslog rules, so make sure that newsyslog is always
# We install filter-syslog rules, so make sure that newsyslog is always
# installed.
# installed.
class
base::os::debian
{
#
# PARAMETERS
# ----------
#
# $apt_cache_notin_tmp: If you want apt to use a directory other than
# /tmp for its temporary cache, set this parameter to "true". This is needed
# if the /tmp partition is set to "noexec" (apt often needs to execture
# configuration files as part of an install or uninstall).
#
# If $apt_cache_notin_tmp is set to "true" and $apt_cache_directory is
# undefined, then apt will use /var/cache/apt/tmp for its temporary
# directory. If you want to specify a different directory, set
# the $apt_cache_tmp_dir.
#
# $apt_cache_tmp_dir: if $apt_cache_notin_tmp is set to "false" this
# parameter is ignored. If $apt_cache_notin_tmp is set to "true" then we
# configure apt to use $apt_cache_tmp_dir as apt's temporary directory
# during package installs and uninstalls.
#
# NOTE! If you use $apt_cache_tmp_dir to override the default, then you
# must have $apt_cache_tmp_dir as a file resource in your own Puppet
# code, otherwise Puppet will fail.
class
base::os::debian
(
$apt_cache_notin_tmp
=
false
,
$apt_cache_tmp_dir
=
'/var/cache/apt/tmp'
){
include
base::newsyslog
include
base::newsyslog
# This really needs to be put somewhere else so that all possible uses of
# This really needs to be put somewhere else so that all possible uses of
...
@@ -76,6 +102,22 @@ class base::os::debian {
...
@@ -76,6 +102,22 @@ class base::os::debian {
content
=>
template
(
'base/os/preferences/backports.erb'
);
content
=>
template
(
'base/os/preferences/backports.erb'
);
}
}
if
(
$apt_cache_notin_tmp
)
{
# If we did NOT override the apt cache directory make sure that
# '/var/cache/apt/tmp' exists.
if
(
$apt_cache_tmp_dir
==
'/var/cache/apt/tmp'
)
{
file
{
$apt_cache_tmp_dir
:
ensure
=>
directory
,
require
=>
Package
[
'apt'
],
}
}
file
{
'/etc/apt/preferences.d/apt_cache_tmp'
:
content
=>
template
(
'base/os/etc/apt/preferences.d/apt_cache_tmp.erb'
),
require
=>
File
[
$apt_cache_tmp_dir
],
}
}
# lsb-release pulls in all of lsb unless we disable recommends handling
# lsb-release pulls in all of lsb unless we disable recommends handling
# first, so make sure that we've done that. That should be handled by the
# first, so make sure that we've done that. That should be handled by the
# global Package require set above.
# global Package require set above.
...
@@ -119,7 +161,7 @@ class base::os::debian {
...
@@ -119,7 +161,7 @@ class base::os::debian {
'wheezy'
:
{
package
{
'emacs23-nox'
:
ensure
=>
present
}
}
'wheezy'
:
{
package
{
'emacs23-nox'
:
ensure
=>
present
}
}
'jessie'
:
{
package
{
'emacs24-nox'
:
ensure
=>
present
}
}
'jessie'
:
{
package
{
'emacs24-nox'
:
ensure
=>
present
}
}
}
}
# Ensure this file exists, containing only a comment.
# Ensure this file exists, containing only a comment.
file
{
'/etc/default/locale'
:
file
{
'/etc/default/locale'
:
ensure
=>
present
,
ensure
=>
present
,
...
...
This diff is collapsed.
Click to expand it.
templates/os/etc/apt/preferences.d/apt_cache_tmp.erb
0 → 100644
+
1
−
0
View file @
3aef7387
APT::ExtractTemplates::TempDir "
<%=
@apt_cache_tmp_dir
%>
";
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment