Reddit DevOps
277 subscribers
69 photos
32.2K links
Reddit DevOps. #devops
Thanks @reddit2telegram and @r_channels
Download Telegram
Using Packer to fetch Ubuntu ISO and convert to template - vSphere -- waiting for IP address issue

As the title states, attempting to use packer, to fetch a ISO, pull it down, configure it with basic items and then convert to a template.

It works up until the very end, when at the packer CLI, it says "Waiting for SSH to become available".When i log into vsphere, I can see the image boot up, run through the installer then gets to the login prompt. Even though it has an IP address, its at the login prompt, packer is 'stuck' waiting or SSH to become available. (i can SSH to the box to verify openssh-server is accepting connections, which it is).

==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: ssh: handshake failed: ssh: unable to authenticate, attempted methods [password none], no supported methods remain

Ultimately what happens is a timeout, then every backs out, the VM is deleted.

I feel I am so close and missing something very very easy and simple.

I am using packer 1.35 and jetbrains vpshere-iso plugin.

Here are my files:

{
"builders": [
{
"type": "vsphere-iso",

"vcenter_server": "{{user `vcenter_server`}}",
"username": "{{user `username`}}",
"password": "{{user `password`}}",
"insecure_connection": "true",

"vm_name": "temp_ubuntu18",
"datastore": "{{user `datastore`}}",
"folder": "{{user `folder`}}",
"convert_to_template": "true",
"cluster": "{{user `cluster`}}",
"network": "{{user `network`}}",
"boot_order": "disk,cdrom",

"guest_os_type": "ubuntu64Guest",

"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",

"CPUs": 1,
"RAM": 1024,
"RAM_reserve_all": true,

"disk_controller_type": "pvscsi",
"disk_size": 16768,
"disk_thin_provisioned": true,

"network_card": "vmxnet3",

"iso_urls": "https://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.3-server-amd64.iso",
"iso_checksum": "7d8e0055d663bffa27c1718685085626cb59346e7626ba3d3f476322271f573e",
"iso_checksum_type": "sha256",

"floppy_files": [
"./preseed.cfg"
],
"boot_command": [
"<enter><wait><f6><wait><esc><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/install/vmlinuz",
" initrd=/install/initrd.gz",
" priority=critical",
" locale=en_US",
" file=/media/preseed.cfg",
"<enter>"
]
}
],

"provisioners": [
{
"type": "shell",
"inline": ["echo 'template build complete'"]
}
]
}

Here is my variables file:

{
"vcenter_server":"xxx.xxx.xxx.xxx",
"username":"XXXXXX",
"password":"XXXXX",
"datastore":iSCSI-storage",
"folder": "_Templates",
"cluster": "crazytown",
"network": "vDEV",
"ssh_username": "root",
"ssh_password": "XXXXX"
}

Finally, my preseed file:

d-i passwd/user-fullname string dude
d-i passwd/username string dude
d-i passwd/user-password password mypassword
d-i passwd/user-password-again password mypassword
d-i user-setup/allow-password-weak boolean true

d-i
partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

d-i passwd/root-login boolean true
d-i passwd/root-password password mypassword
d-i passwd/root-password-again password mypassword


d-i pkgsel/include string open-vm-tools openssh-server

d-i grub-installer/only_debian boolean true

d-i preseed/late_command string \
echo 'dude ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/dude ; \
in-target chmod 440 /etc/sudoers.d/dude;

d-i finish-install/reboot_in_progress note

Driving me bonkers because i feel it is simple.

Something simple I am missing? something out of order?

Appreciate the help and extra eyes.

Cheers

&#x200B;

TCG

https://redd.it/eip3ne
@r_devops
Looking for a dashboard for github actions

Hi, I'm used to dashboards surfacing CI/CD status on GitLab, is there anything like that for github actions?

https://redd.it/eioj0b
@r_devops
What are the chances of getting remote DevOp Jobs?

Hey! I am from a small island in the Caribbean, what are the chances of getting an entry level remote job as a DevOp with foreign companies?

My only option is remote work due to my location and opportunities at hand.

Thanks!

https://redd.it/eikjuh
@r_devops
Considering if to continue in the devops field

I guess this is more a personal issue, but an insight might be helpful.

I'm a woman in my mid 30's. Currently, was fired from my job after 3 months. I worked part-time (60%) The mutual understanding is this wasn't necessarily based on technical issues but more fitting issues. I have good skills but I also think they should be improved.
The company is around 20 people, there are 2 devs in Ukraine while the managers are based in my country. I was the only woman in the office.
I felt they don't really had understanding what Devops means and everything was abstract, which made it dificult to accomplish anything.

The reason I work part-time is because Im also doing art and painting. This was a hobby that got extended and it's hard for me to let go.
In my country, it's dificult to find good devops so even when sent resume to full time jobs I still got called and they agreed to consider 60%.
I'll admit that I have mild mental issues like anxiety and depression that I'm handling but it's still exist.
My fear is, that even if i'll still be able to find something else the characteristics made me failed here will be similar in other places. In the long run, I prefer to do a change now than in my 40's.


TL;DR- a woman in mid 30's, artist, some mental issues, still a devops for now. What do you think my options and if I have any?

https://redd.it/eilqta
@r_devops
Need suggestions for contract templates for DevOps side work

Finally getting back into contracting with a job for a former manager to help him set up his infrastructure from scratch for his new business. Last time I did some contract jobs, I didn't really do things right and left myself open to some serious liability. This time around I've established an LLC with a business partner who is handling security related jobs, a separate business account, insurance, and soon a CPA and expense tracking software.

I was wondering if there are any good contract templates that are geared towards this type of work that folks here can recommend?

Any other recommendations on doing this the right way? Thanks!

https://redd.it/eijfsp
@r_devops
suggestion on what to explore after deploying a model using

flask, gunicorn, docker at heroku/AWS, nginx( indirectly using elastic beanstalk).

what would be the next thing that I should explore? \*nothing too difficult\*

I'm going this route ( back to front ) as I'm in an analyst.

Thanks.

https://redd.it/eiim8x
@r_devops
Where are Rspec reports created?

Hi there,

Apologies for a noob question. I am trying to upload the Rspec reports generated during a Jenkins AMI build. When the build reached Test stage, archiveArtifact fails saying serverspec.* Doesn't match any pattern. So I was wondering where the reports are saved and with which name?

Thanks

https://redd.it/eiu5dt
@r_devops
Suggestion on choosing the auth backend in vault system

Initially [posted](https://www.reddit.com/r/hashicorp/comments/eig3su/suggestion_on_choosing_the_auth_backend_in_vault/) in r/Hashicorp for suggestions and as there is no reply, trying my luck in devops community.

I am building an internal app for our ops team with intention to login using an SSO credentials and then request the ActiveDirectory, AWS, Azure and GoogleCloud secrets from the Vault. In a way similar to what [BanzaiCloudPipeline](https://banzaicloud.com/blog/oauth2-vault/) is doing. But there are few changes.

The way I am expecting it to work is:

1. I would keep the users and his roles in the app backend database system.
2. User will login using SSO creds.
3. After successful authentication, will get a token from the auth-provider and also will create a session for user in the app.
4. I have the information of a session token and what role the user should've at this point.
5. Next, I would need to get policy and a token for each user from vault using the information that I have collected till this point without requesting anything else from user.

Up to 4th point, I can design the workflow but have confusion on how to implement the last point w.r.t each user from the Vault.

So, using which auth backend, can I implement the above workflow without introducing additional complexity?

If the question is out of scope, that's fine.

https://redd.it/eitppk
@r_devops
Which DevOps tool you would like to replace in 2020 and why.

Even though ours is a startup, I would like to replace Docker Swarm with Kubernetes.
I would like to see it’s power that everyone else is talking about. Our containers and workloads are increasing in number and yes I think it’s better to make use of Kubernetes at this point.

Which tool your world like to replace from your existing stack and why?

https://redd.it/eitfsi
@r_devops
How do you guys handle rollbacks with automated CI/CD pipelines?

Title. If you have a bad release, what do you do? Revert master to the last good commit, then let the pipeline take care of things? An alternative process?

https://redd.it/eid1ak
@r_devops
Help: Having trouble with routing urls

For a school project, we need to deploy our spring boot apps on kubernetes servers. Right now I am testing locally, but I am having some trouble getting everything to work together. At this point, I have a frontend, with a custom nginx docker image. A backend docker image and an ingress. I am testing everything locally right now. I can access the frontend, through localhost (as defined in the ingress). I can use the IP address of the backend service, to do the url GET's (like /stock/{id}). But somehow my ingress doesn't route it correctly. localhost/stock/id doesn't shows an 404. Could you guys tell me what I am doing wrong?

I also don't know what url to use in the frontend, to refer to these calls. Normally you could use the dns name for the requests, but since we probably don't have a dns, I don't know if you can dynamically get the server ip to use? Right now I could use localhost, but what when I run it on the servers we get to use?

If you need any other files, please let me know. Thanks in advance.

The ingress yaml:

```
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gateway-ingress
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "*"
nginx.ingress.kubernetes.io/rewrite-target: /

spec:
backend:
serviceName: default-http-backend
servicePort: 8080
rules:
- host: localhost
http:
paths:
- path: /stock*
backend:
serviceName: shop
servicePort: 2230
- path: /shopItem*
backend:
serviceName: shop
servicePort: 2230
- path: /transaction*
backend:
serviceName: shop
servicePort: 2230
- path: /
backend:
serviceName: frontend
servicePort: 80
```
The nxinx config file:
```
upstream shop {
server shop;
}


server {
listen 80;
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;

location / {
include /etc/nginx/mime.types;
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
gzip on;

}
location /stock {
proxy_pass https://shop;
}
location /shopItem {
proxy_pass https://shop;
}
location /transaction {
proxy_pass https://shop;
}
}

```

https://redd.it/eiyhfp
@r_devops
What are your devops goals for 2020?

Any tech you want to use?
Anything you don’t like?
Things you wish existed to make our lives easier?

My personal goal is to explore different CICD tools as I’ve only used CircleCI in the past.

https://redd.it/ej3oid
@r_devops
Creating a CI/CD

My team and I are relatively inexperienced with DevOps. We have started to create a CI pipeline for a product. First step is to build on commits (on commit triggers). Before, this product would take over 2 hours to build. What we have done (not sure if this is the best way), is to build individual components of this product (only what has changed) and package it using the existing other components to create the whole product.

These separate component builds are run in parallel, so anytime a developer commits to one component, it will generate a new version of that component without having to wait for the previous build to finish. The latest of each component is then packaged together.

Now some details on how we are doing this:

We are using Jenkins pipelines, one pipeline for each component. The commit trigger is linked to GitLab. Note, we are limited to using Jenkins and GitLab due to security restrictions, access, and political reasons. To change these tools is whole other discussion.

It is a .NET build, using visual studio so we have multiple Windows VMs on a server waiting idle for when it is needed to do a build. When a commit happens, one VM is picked to build and generate artifacts. After a component is built successfully and unit tests are run, it is put into Artifactory, replacing the previous version.

Goal of this was to reduce the time it took to build so that the developers can be aware if their latest commit broke the build or not.

Looking for suggestions on improvements and changes we can do while this project is in the early stages. It would be nice to reduce the number of pipelines and the number of VMs.

https://redd.it/ej3mc2
@r_devops
Guidance on getting into DevOps from Sys Admin

Hello,

I've been reading around and flopping back and forth between different certs every time I stumble on new information. I'm a bit lost on what to ultimately pursue and wanted to ask for your advice on how to proceed.

Some background on my current experience. I've worked a cumulative of 3 years doing help desk, PowerShell scripting, O365 management, SharePoint administration, and a little bit of server work. The places I worked at primarily employed Windows environments. I've worked a little bit with Linux in an academic environment for programming classes during college.

I'm slowly being given tasks to prepare me for a DevOps role at my current job. We use an Azure environment, so I'm being shown how are VM web servers and databases are being built as well as some of the processes that we employ such as database refreshes. Before being offered this direction an opportunity, I was studying the AWS Solutions Architect course on CloudGuru. I've taken a pause and switched to studying Developing Solutions for Microsoft Azure (AZ-203) on Pluralsight. I know I'm going to be staying at this current company for another 18-20 months because I'll be moving afterwards, so that's why I'm hesitant on my choices because I feel that AWS, Kubernetes, and the typical tools listed on most resources is where I should be studying, but my current work doesn't employ any of that. I'm going to be moving to the Bay Area in Northern California, so I want to prepare as best I can to enter that tech hub.

Any advice is much appreciated. Thank you!

https://redd.it/ej6ja2
@r_devops
Coding certifications for Devops?

I work on a small team of devops engineers some of whom are just beginning their careers in the devops field. One thing that I feel very strongly about is that in order to succeed in this field, you need to be able to code. We have been doing team mentoring on this subject but I was wondering if there are any good formal training/certification courses that folks here would recommend concerning coding. Not coding with the goal of being a full on developer but to be able to write scripts and basic coding algorithms for CI/CD pipelines and to be able to stitch together services that we use.

https://redd.it/eiwhk0
@r_devops
CircleCI New UI

Anybody know what's going on with CircleCI's "new" UI?!

It seems to be a half-baked rewrite in React that they are trying to force down everybody's throat now. Been in progress for a long time but there is still tons of missing information and features. It only applies to a small section of the site as well; going to org settings or insights switches back to the "old" experience.

A new post on the forum indicates they won't be spending time fixing bugs in the legacy, feature complete, UI in favor of allocating all resources on the new UI. The way everything is going down makes it feel very political even from the outside. I can't imagine it's a very popular project externally or internally.

The user hostility in the way they are now trying to get people to use it is concerning if it's indicative of the future IMHO.

https://redd.it/ej1rnz
@r_devops
AWX Linode API error

I'm getting this error when trying to run a simple playbook in awx.

>ERROR! the Linode dynamic inventory plugin requires linode\_api4.

the play is nothing special just runs apt or yum update against some VPS hosts

`---`
`- hosts: all`
`tasks:`
`- name: update packages`
`apt:`
`name: "*"`
`state: latest`
`update_cache: yes`
`when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'`

`- name: update yum`
`yum:`
`name: "*"`
`state: latest`
`update_cache: yes`
`when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'`
Has anyone seen this b4? I haven't been able to find answers anywhere, I even went as far as installing the linode\_api4 pip module

https://redd.it/eiypzo
@r_devops
Repeat builds for Build Validation and on merge

So we're got Build Validation on to ensure our things build before the PR can be completed.

We've also got builds triggered on commit to our main branch, which then gets deployed to our QA server.

The problem is when someone puts in a PR, it builds to verify that it's okay to merge, then once merged, it builds the same thing over again, wasting time. Sometimes it's needed if there's multiple PRs (validations last for 12 hours), but there are often times when it's not. Is there a way to tell it that it's building the same thing again and cut down on this duplication of work?

https://redd.it/ej9eqm
@r_devops
Does your company use a geolocation service?

We are looking to evaluate geolocation services to replace a legacy hosted third party service and was wondering what others may have experience with.

https://redd.it/ej8jwd
@r_devops