1. Login to Ansible management server/machine. Create SSH keys in Ansible host machine by executing the below command: (if you already have keys created, please skip this step) ssh-keygen
enter three times..now you will see keys successfully created.
2. Execute the below command on Ansible management node and copy the public key content: sudo cat ~/.ssh/id_rsa.pub
copy the above output.
3. Now login to target node, execute the below command to open the file sudo vi /home/ubuntu/.ssh/authorized_keys type shift A and then enter now
and paste the key in the above file. please do not delete any existing values in this file.
4. Now go back to Ansible mgmt node, do changes in /etc/ansible/hosts file to include the node you will be installing software. Make sure you add public IP address of target node as highlighted below in red color: sudo vi /etc/ansible/hosts [My_Group] xx.xx.xx.xx ansible_ssh_user=ubuntu ansible_ssh_private_key_file=~/.ssh/id_rsa ansible_python_interpreter=/usr/bin/python3
5. make changes in playbooks as given below, cd ~/playbooks
GPG error: https://pkg.jenkins.io/debian-stable binary/ Release:
The following signatures couldn't be verified because the public key is
not available: NO_PUBKEY FEF32E745F2C3D5 E: The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed.
This is a very common Jenkins install issue on Ubuntu/Debian. It happens because APT no longer trusts the old Jenkins GPG key method.
Slack is popular collaboration tool used at work by many companies.
Slack can be integrated with CI tools such as Jenkins, Azure DevOps(VSTS). We will see how to integrate
with Azure Build pipelines.
Pre-requisites:
1. Azure pipelines setup
2. Slack channel setup
Azure DevOps & Slack integration steps
1. Go to slack.com and sign in to workspace.
2. Go to channel where you would like to receive push notification from Azure DevOps. Click on more and Add apps
3. Add Visual Studio Team Services App
4. Add Configuration
5. And then select channel to post notification and add the channel
6. In Azure DevOps Dashboard, click on Project settings.
7. Click on Service Hooks tab and then click create subscriptions button to add a new service hook.
8. Select Slack from the list of services, and press the Next button.
9. On the Trigger screen, choose the event that you’d like to trigger the notification, and add any filters. Press the Next button to continue.
10. On the Action screen, add the URL as the Slack Webhook URL and press Finish when you are done.
Now whenever Azure pipelines runs any builds, it will send push notifications to the Slack channel. Please watch the above steps in YouTube channel:
ERROR: Can't construct a java object for tag:yaml.org,2002:io.kubernetes.client.openapi.models.V1Deployment; exception=Class not found: io.kubernetes.client.openapi.models.V1Deployment
in 'reader', line 1, column 1:
apiVersion: apps/v1
Caused by: hudson.remoting.ProxyException: org.yaml.snakeyaml.error.YAMLException: Class not found: io.kubernetes.client.openapi.models.V1Deployment
at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:664)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:322)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331)
... 30 more
Fix/Workaround:
Try the deployment in Jenkins slave node instead of deploying from Jenkins Master.
Extract TeamCity
tar -xvf TeamCity-2020.1.5.tar.gz
sudo mkdir /opt/JetBrains
sudo mv TeamCity /opt/JetBrains/TeamCity
cd /opt/JetBrains/TeamCity
Create service file
sudo nano /etc/init.d/teamcity
(copy the whole text colored in green) #!/bin/sh ### BEGIN INIT INFO # Provides: TeamCity autostart # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start teamcity daemon at boot time # Description: Enable service provided by daemon. # /etc/init.d/teamcity - startup script for teamcity ### END INIT INFO # Ensure you enter the right user name that TeamCity will run under USER="ubuntu" export TEAMCITY_DATA_PATH="/opt/JetBrains/TeamCity/.BuildServer" case $1 in start) start-stop-daemon --start -c $USER --exec /opt/JetBrains/TeamCity/bin/runAll.sh start ;; stop) start-stop-daemon --start -c $USER --exec /opt/JetBrains/TeamCity/bin/runAll.sh stop ;; esac exit 0
Ctrl + O enter
Ctrl + X enter
sudo chmod +x /etc/init.d/teamcity
sudo update-rc.d teamcity defaults
sudo /etc/init.d/teamcity start
Open browser and access team city url in the browser
http://public_dns_name:8111
Click on Proceed.
Select database type as jdbc driver as Postgres SQL from the dropdown and Click on Proceed.
now you need to download the jdbc driver at below location.
cd /opt/JetBrains/TeamCity/.BuildServer/lib/jdbc
sudo wget https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar
Select database type as PostgreSQL
Refresh JDBC driver
You should see like this —> Loaded PostgreSQL JDBC driver version: 9.4
Now provide the below info
Enter database Host - localhost
Enter database name - teamcity
User name - teamcity
Password - password
Click on Proceed
please wait and watch..As It may take a few mins…
Scroll down the page, Accept license agreement
Uncheck Send anonymous usage statistics
Continue button, Register as a user and create an account