Skip to content

Commit 840f0ad

Browse files
committed
Add example profile configuration, update docs
1 parent e63f515 commit 840f0ad

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,14 @@ You can find the profiles in your system with `elastic-package profiles list`.
487487
You can delete profiles with `elastic-package profiles delete`.
488488

489489
Each profile can have a `config.yml` file that allows to persist configuration settings
490-
that apply only to commands using this profile.
490+
that apply only to commands using this profile. You can find a `config.yml.example` that
491+
you can copy to start.
491492

492493
The following settings are available per profile:
493494

494495
* `stack.geoip_dir` defines a directory with GeoIP databases that can be used by
495-
Elasticsearch in stacks managed by elastic-package.
496+
Elasticsearch in stacks managed by elastic-package. It is recommended to use
497+
an absolute path, out of the `.elastic-package` directory.
496498

497499
## Development
498500

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Directory containing GeoIP databases for stacks managed by elastic-agent.
2+
# stack.geoip_dir: "/path/to/geoip_dir/"

internal/profile/profile.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package profile
66

77
import (
8+
"embed"
89
"errors"
910
"fmt"
1011
"os"
@@ -28,12 +29,20 @@ const (
2829
DefaultProfile = "default"
2930
)
3031

32+
//go:embed _static
33+
var static embed.FS
34+
3135
var (
36+
staticSource = resource.NewSourceFS(static)
3237
profileResources = []resource.Resource{
3338
&resource.File{
3439
Path: PackageProfileMetaFile,
3540
Content: profileMetadataContent,
3641
},
42+
&resource.File{
43+
Path: PackageProfileConfigFile + ".example",
44+
Content: staticSource.File("_static/config.yml.example"),
45+
},
3746
}
3847
)
3948

tools/readme/readme.md.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ You can find the profiles in your system with `elastic-package profiles list`.
103103
You can delete profiles with `elastic-package profiles delete`.
104104

105105
Each profile can have a `config.yml` file that allows to persist configuration settings
106-
that apply only to commands using this profile.
106+
that apply only to commands using this profile. You can find a `config.yml.example` that
107+
you can copy to start.
107108

108109
The following settings are available per profile:
109110

110111
* `stack.geoip_dir` defines a directory with GeoIP databases that can be used by
111-
Elasticsearch in stacks managed by elastic-package.
112+
Elasticsearch in stacks managed by elastic-package. It is recommended to use
113+
an absolute path, out of the `.elastic-package` directory.
112114

113115
## Development
114116

0 commit comments

Comments
 (0)