-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new file and command component usage across markdown files
Ticket: ENT-10940 Changelog: None Signed-off-by: Mikita Pilinka <[email protected]>
- Loading branch information
1 parent
c74a0c4
commit f1df951
Showing
14 changed files
with
130 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,14 +26,15 @@ https://github.com/cfengine/promise-type-template | |
|
||
We can add it to our project with the full URL: | ||
|
||
``` | ||
```command | ||
cfbs add https://github.com/cfengine/promise-type-template | ||
``` | ||
|
||
From that repo, we have now added a new promise type, it is called `git_example` to avoid confusion with the "real" git promise type used earlier in the tutorial. | ||
Then, we should edit our policy example, `my_policy.cf` to use this module: | ||
|
||
```cfengine3 | ||
[file=my_policy.cf] | ||
bundle agent hello_world | ||
{ | ||
meta: | ||
|
@@ -48,19 +49,19 @@ bundle agent hello_world | |
|
||
That's it, you can now build and deploy: | ||
|
||
``` | ||
```command | ||
cfbs build && cf-remote deploy | ||
``` | ||
|
||
And to test it, we can delete the folder and run the agent again: | ||
|
||
``` | ||
```command | ||
cf-remote sudo -H hub "rm -rf /tmp/hugo && cf-agent -KI | grep hugo" | ||
``` | ||
|
||
The output printed from that remote machine shows that `cf-agent` cloned the repository again, after we deleted it: | ||
|
||
``` | ||
```output | ||
[email protected]: 'rm -rf /tmp/hugo && cf-agent -KI | grep hugo' -> ' info: Cloning 'https://github.com/gohugoio/hugo.git' -> '/tmp/hugo'...' | ||
[email protected]: ' info: Successfully cloned 'https://github.com/gohugoio/hugo.git' -> '/tmp/hugo'' | ||
``` | ||
|
@@ -83,21 +84,21 @@ Start by editing `cfbs.json`, at least changing the `repo` and `by` URLs. | |
|
||
To test your changes, make sure they are pushed to GitHub, and re-add your module, for example: | ||
|
||
``` | ||
```command | ||
cfbs remove promise-type-git-example && cfbs add https://github.com/cfengine/promise-type-template | ||
``` | ||
|
||
**Tip:** Replace the URL with your own repository URL when you've create one using the template. | ||
|
||
Then, build and deploy the project again: | ||
|
||
``` | ||
```command | ||
cfbs build && cf-remote deploy | ||
``` | ||
|
||
And just like before, you can run manual agent runs to test: | ||
|
||
``` | ||
```command | ||
cf-remote sudo -H hub "rm -rf /tmp/hugo && cf-agent -KI" | ||
``` | ||
|
||
|
@@ -106,15 +107,15 @@ cf-remote sudo -H hub "rm -rf /tmp/hugo && cf-agent -KI" | |
As you've changed the high level things, like file name, promise type name, URLs, etc. and deployed that, the only thing you need to edit is the contents of the python file. | ||
So, to test your changes to the python file, a full build is not really necessary, you can just copy over that one file: | ||
|
||
``` | ||
```command | ||
cf-remote scp -H hub git_example.py /var/cfengine/masterfiles/modules/promises/git_example.py | ||
``` | ||
|
||
(Assuming you have the `git_example.py` file in the current directory). | ||
|
||
And then you can test it: | ||
|
||
``` | ||
```command | ||
cf-remote sudo -H hub "cf-agent -KIf update.cf && cf-agent -KI" | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,13 +48,16 @@ Run the bootstrap command, **first** on the policy server: | |
1. Find the IP address of your Policy Server: | ||
|
||
|
||
$ ifconfig | ||
```command | ||
ifconfig | ||
``` | ||
|
||
|
||
2. Run the bootstrap command: | ||
|
||
|
||
$ sudo /var/cfengine/bin/cf-agent --bootstrap <IP address of policy server> | ||
```command | ||
sudo /var/cfengine/bin/cf-agent --bootstrap <IP address of policy server> | ||
``` | ||
|
||
|
||
The bootstrap command must then be run on any client attaching itself to this server, using the ip address of the policy server (i.e. exactly the same as the command run on the policy server itself). | ||
|
@@ -78,7 +81,9 @@ together. | |
The preferred way of setting `def.mailfrom` is from the | ||
[augments file][Augments]. | ||
|
||
``` | ||
```json | ||
[file=def.json] | ||
|
||
{ | ||
"vars": { | ||
"mailfrom": "[email protected]", | ||
|
@@ -102,7 +107,8 @@ ensure they have taken effect. | |
The preferred way to disable the agent from sending emails is to define | ||
`cfengine_internal_disable_agent_email` from the [augments file][Augments]. | ||
|
||
``` | ||
```json | ||
[file=def.json] | ||
{ | ||
"classes": { | ||
"cfengine_internal_disable_agent_email": [ "any" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.