adding org files
This commit is contained in:
parent
1176f21314
commit
3045a40ba7
8 changed files with 186 additions and 1 deletions
21
sami/.gitignore
vendored
Normal file
21
sami/.gitignore
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/linux
|
||||||
|
# Edit at https://www.gitignore.io/?templates=linux
|
||||||
|
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/linux
|
||||||
|
|
1
sami/my-cdist/.cdist/files/motd
Normal file
1
sami/my-cdist/.cdist/files/motd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
my message of the day
|
|
@ -0,0 +1,15 @@
|
||||||
|
case "$__target_host" in
|
||||||
|
localhost)
|
||||||
|
#target is configured with cdist
|
||||||
|
__file /etc/cdist-configured
|
||||||
|
|
||||||
|
# motd from th file directory
|
||||||
|
__motd --source "$__files/motd"
|
||||||
|
|
||||||
|
__timezone Europe/Zurich
|
||||||
|
|
||||||
|
# types to be used
|
||||||
|
__my_computer
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -19,7 +19,15 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Ensure sipcalc is present
|
# Ensure sipcalc is present
|
||||||
#
|
|
||||||
|
|
||||||
__package sipcalc --state present
|
__package sipcalc --state present
|
||||||
|
|
||||||
|
__package emacs --state present
|
||||||
|
|
||||||
|
__package firefox --state present
|
||||||
|
|
||||||
|
__package nmap --state present
|
||||||
|
|
||||||
|
__package zsh --state present
|
||||||
|
|
||||||
|
|
63
sami/my-org-files/#cdist.org#
Normal file
63
sami/my-org-files/#cdist.org#
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*** cdist #1: Introduction
|
||||||
|
**** Lecture content
|
||||||
|
***** Objective
|
||||||
|
****** Begin to use cdist
|
||||||
|
***** Steps
|
||||||
|
****** Checkout cdist quickstart https://www.cdi.st/manual/latest/cdist-quickstart.html
|
||||||
|
****** Install cdist locally
|
||||||
|
****** Create a new cdist configuration directory in ~/ungleich-learning-circle/USERNAME/dot-cdist
|
||||||
|
****** Create an empty initial manifest ("use touch")
|
||||||
|
****** Commit that status
|
||||||
|
****** Ensure that you can login as root to localhost via ssh without a password
|
||||||
|
****** Configure cdist to configures the motd of your localhost
|
||||||
|
******* Ensure you have a case block matching on $__target_host
|
||||||
|
******* Use the -c parameter to cdist to specify the configuration directory
|
||||||
|
******* Use the -vv parameter to get more verbose output
|
||||||
|
******* Search for / understand what MOTD stands for
|
||||||
|
****** Configure cdist to create the file /etc/cdist-configured
|
||||||
|
****** Configure cdist to setup the timezone on your local computer
|
||||||
|
****** Configure cdist to ensure emacs is installed
|
||||||
|
****** Ensure that in the end all changes are committed in your repository
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* cdist #5: Generating Code & Exploring
|
||||||
|
|
||||||
|
* Understanding how to generate code and when to use it
|
||||||
|
** define gencode-remote script: ~/.cdist/type/__nginx_site. After manifest is applied it should restart services so configuration is active. Our gencode-remote looks like echo "service nginx restart"
|
||||||
|
|
||||||
|
* Modify the previously created type *__my_nginx_site*
|
||||||
|
** We modify the previously created type so that the gencode-remote script reacts accordingly
|
||||||
|
- echo "if_configurationfile_changes" >> "$__messages_out"
|
||||||
|
|
||||||
|
* Read about cdist messaging
|
||||||
|
** cdist has a simple but powerful way of allowing communication between the initial manifest and types as well as types and types.
|
||||||
|
* What is the difference between gencode-local and gencode-remote?
|
||||||
|
|
||||||
|
** gencode-remote used to generate code to be executed on the target host
|
||||||
|
** gencode-local used to generate code to be executed on the source host
|
38
sami/my-org-files/cdist.org/cdist#1-intro.org
Normal file
38
sami/my-org-files/cdist.org/cdist#1-intro.org
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
*** cdist #1: Introduction
|
||||||
|
**** Lecture content
|
||||||
|
***** Objective
|
||||||
|
****** Begin to use cdist
|
||||||
|
***** Steps
|
||||||
|
****** Install cdist locally https://www.cdi.st/manual/latest/cdist-quickstart.html
|
||||||
|
****** Create a new cdist configuration directory in ~/ungleich-learning-circle/USERNAME/dot-cdist
|
||||||
|
****** Create an empty initial manifest
|
||||||
|
****** Commit that status
|
||||||
|
****** Ensure that you can login as root to localhost via ssh without a password
|
||||||
|
****** Configure cdist to configures the motd of your localhost
|
||||||
|
******* Ensure you have a case block matching on $__target_host
|
||||||
|
******* Use the -c parameter to cdist to specify the configuration directory
|
||||||
|
******* Use the -vv parameter to get more verbose output
|
||||||
|
****** Configure cdist to create the file /etc/cdist-configured
|
||||||
|
****** Configure cdist to setup the timezone on your local computer
|
||||||
|
****** Configure cdist to ensure emacs is installed
|
||||||
|
****** Ensure that in the end all changes are committed in your repository
|
||||||
|
|
||||||
|
* init.file
|
||||||
|
- sami@cdist/manifest$ cat init
|
||||||
|
case "$__target_host" in
|
||||||
|
localhost)
|
||||||
|
#target is configured with cdist
|
||||||
|
__file /etc/cdist-configured
|
||||||
|
|
||||||
|
# motd from th file directory
|
||||||
|
__motd --source "$__files/motd"
|
||||||
|
|
||||||
|
__timezone Europe/Zurich
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
* Types manifest for installing packages or insuring that packages are installed
|
||||||
|
- __package emacs --state present
|
24
sami/my-org-files/cdist.org/cdist#2-type.org
Normal file
24
sami/my-org-files/cdist.org/cdist#2-type.org
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
*** cdist #2: Your first cdist type
|
||||||
|
**** Lecture content
|
||||||
|
***** Objective
|
||||||
|
****** Begin to understand how cdist types function
|
||||||
|
******* Types are the main component of cdist and define functionality. If you use cdist, you'll write a type for every functionality you would like to use.
|
||||||
|
***** Steps
|
||||||
|
****** Create a new type named `__my_computer`
|
||||||
|
- Mark the type as a singleton type (If a type is flagged as a singleton, it may be used only once per host.)
|
||||||
|
- Create a `manifest` file in it
|
||||||
|
- Use this type to install the following packages: zsh, mosh, emacs, nmap, sipcalc
|
||||||
|
- Edit the *initial manifest* and use **__my_computer** - Here we have to simply add __my_computer in the types file
|
||||||
|
**localhost**
|
||||||
|
- Match using the $__target_host variable
|
||||||
|
****** Modify your type to use a *for loop* to install the packages
|
||||||
|
****** Deploy / manage your ~/.emacs file in this type
|
||||||
|
- Ensure that permissions and ownership are correct
|
||||||
|
****** Use different *verbosity* levels when configuring
|
||||||
|
****** Ensure that all your changes are committed and pushed in your ungleich-learning-circle repository
|
||||||
|
- Use magit inside emacs for that
|
||||||
|
***** Documentation steps to be done in cdist.org
|
||||||
|
- Create a new org document named `cdist.org` in the safind . -name "~/.emacs"me folder as the learning.org file
|
||||||
|
- Explain the difference between a singleton and non-singleton type
|
||||||
|
- Explain the difference between the different verbosity levels
|
||||||
|
- Document (copy&paste) some of the cdist runs in a "log" section```find . -name "~/.emacs"
|
15
sami/my-org-files/cdist.org/cdist.org
Normal file
15
sami/my-org-files/cdist.org/cdist.org
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
* cdist #5: Generating Code & Exploring
|
||||||
|
|
||||||
|
* Understanding how to generate code and when to use it
|
||||||
|
** define gencode-remote script: ~/.cdist/type/__nginx_site. After manifest is applied it should restart services so configuration is active. Our gencode-remote looks like echo "service nginx restart"
|
||||||
|
|
||||||
|
* Modify the previously created type *__my_nginx_site*
|
||||||
|
** We modify the previously created type so that the gencode-remote script reacts accordingly
|
||||||
|
- echo "if_configurationfile_changes" >> "$__messages_out"
|
||||||
|
|
||||||
|
* Read about cdist messaging
|
||||||
|
** cdist has a simple but powerful way of allowing communication between the initial manifest and types as well as types and types.
|
||||||
|
* What is the difference between gencode-local and gencode-remote?
|
||||||
|
|
||||||
|
** gencode-remote used to generate code to be executed on the target host
|
||||||
|
** gencode-local used to generate code to be executed on the source host
|
Loading…
Reference in a new issue