This file contains hidden or 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
Error: cannot see nodes even "kubeadmin init" looks okej | |
>kubectl get nodes | |
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes") | |
Solution: | |
[root@kubint01 ~]# cp /etc/kubernetes/kubelet.conf ~/.kube/config | |
[root@kubint01 ~]# export KUBECONFIG=$HOME/.kube/config | |
[root@kubint01 ~]# echo $KUBECONFIG | |
/root/.kube/admin.conf | |
[root@kubint01 ~]# kubectl get nodes |
This file contains hidden or 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
#!groovy | |
@Library('deliveryLib')_ | |
pipeline{ | |
agent {} | |
environment{ VAR = credentials(VAL)} | |
options{} | |
tools{maven '****'} | |
triggers{ cron('H */4 * * 1-5') } | |
parameters{} | |
stages{ |
This file contains hidden or 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
We use mattermost along with hubot for some internal fun stuff | |
the settings requires: | |
1. a server has mattermost running on | |
2. a server had hubot running on (could be the same server as the one mattermost is, or a dedicated one) in my case, two different servers | |
3. a jenkins instance (this is only when you want to interact with jenkins for some more serious stuff) | |
in mattermost, it requires: | |
1. public channel which hubot can read from (as incoming) and write to (as outgoing) | |
* remember in mattermost it is not possible to convert a public to private or viceversa , this can be done in slack | |
2. token generated by outgoing webhook : (example is based on I have a public channel named "Jon" |
This file contains hidden or 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
sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux |
This file contains hidden or 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
#ansible-vault file# | |
create a file in your ansible, e.g mySecret.yml | |
>cat mySecret.yml | |
--- | |
myBankId: | | |
12345 | |
myPin: | | |
abcd | |
myJenkinsPsw: | | |
!"#¤% |
This file contains hidden or 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
there are something need to check for your ssh if you try to use publickey but it does not work for you (still ask for password) | |
1. /etc/ssh/sshd_config on server should allow correct group : | |
> AllowGroups groupA groupB | |
2. on the target machine, ssh users folder should have right permission | |
700 .ssh/authorized_keys | |
700 .ssh/ |
This file contains hidden or 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
ISSUE: | |
in module "unarchive" | |
- owner and group only set the file after decompress but not the folders | |
- need to use "file" module and recurse=yes set owner and group on the "top" folder after unarchive | |
Template: | |
use variable in template, ansible would set value during this template is called | |
use -force can overwrite any difference on target machine's template file with current one in ansible (after variable replace with value) | |
This file contains hidden or 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
1. install flyway command line by downloading: flyway-commandline-4.2.0-linux-x64.tar.gz (or some later version) | |
2. >tar xvfz flyway-commandline-4.2.0-linux-x64.tar.gz | |
3. >cd flyway-4.2.0 | |
4. >vi conf/flyway.conf | |
: user, pasword, url need to be updated with correct value | |
5. >vi sql/V1__Create_person_table.sql | |
: put how you want to perform on the first transition, say create table etc | |
6. >flyway validate to check it first | |
7. >flyway migrate | |
: if you see ERROR, try to fix it in the *.sql file you created above |
This file contains hidden or 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
class jenkins_slave::erlang ( $version ) { | |
file { '/etc/yum.repos.d/erlang.repo': | |
source => 'puppet:///modules/jenkins_slave/erlang.repo', | |
owner => 'root', | |
group => 'root', | |
mode => '0640', | |
} | |
package {'erlang': |
This file contains hidden or 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
Limitation in Jenkins 2.0 pipeline: | |
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method java.lang.String split java.lang.String int | |
when in jenkinsfile: | |
def a = "jij-fhsif-vasdfs-sfa" | |
String[] str = a.split('-',2) | |
echo str[1] | |
also code like this: | |
def (first, other) = a.split('-',2) | |
seems not work on my side |