Kole  Haag

Kole Haag

1598425200

How to use an Apple ii!

![its apples, and we’re about to learn how to use an Apple ]…. i dunno…

Photo by Liana Mikah on Unsplash

Long before the iPad, iPhone, and MacBook, Apple’s most successful product was the Apple ii. The Apple ii (or Apple ][, if you’re feeling stylish) is a personal computer from 1977 that sold exceptionally well for Apple, becoming the first personal computer to achieve commercial success. This was, in part, due to its appeal to not only hobbyists but also “normal” people. What this success means for us is that there are a huge amount of games and programs that can run on the hardware. In this article, we will go through the process of emulating the Apple ii and look at how to load programs onto it. The program we will load will be a small piece of code that we will write ourselves. However, this process could also be used to load on The Oregon Trail game, Ultima 1, Lode Runner, or any other piece of famous Apple ii software.

This is a multi-step process. We will focus on how to get this to run on Linux or Mac, but this should also be transferable to Windows. Let’s quickly break the process down:

  • We will need to find a way to emulate the Apple ii (we’ll use AppleWin)
  • For those of us without a Windows machine, we will need a way to run the emulation (we’ll use Wine for this)
  • We will communicate between our modern machine and the emulator by using CiderPress
  • We will compile 6502 Assembly code using cc65

I will also assume a basic knowledge of how to navigate the terminal. If you aren’t familiar with ls-ing and cd-ing you can find some tips here. This is part 5 of my learning assembly series, but whether or not you have read the rest should not matter (hopefully). If all you want to know is how to emulate the Apple ii this should be a groovy read as well.

![Some people from like 40 years ago playing with an Apple ]

A 1976 ad for the Apple ii — Source


Wine

If you run Mac or Linux, obviously, you cannot natively run Windows programs. However, the programs that we want to use in this article are exclusively on Windows. We don’t want to install and pay for a large emulator or dual-boot our laptops so to avoid this we can use Wine. Wine (an acronym of Wine Is Not an Emulator) is described as not being an emulator or virtual machine. Instead, it is described as a “compatibility layer capable of running Windows applications”. Honestly, I don’t know what that means but — nevertheless — it will allow us to run the Window’s programs required. To install:

Mac

Open the terminal and enter the following commands:

  • brew cask install xquartz
  • brew cask install wine-stable

Linux

Go to the terminal and enter:

  • sudo apt-get install wine-stable

Some websites give instructions on how to install newer versions of Wine on Linux, but the above command works correctly as well.

Let’s get installing!

We need to download the two Windows programs we need. They are available here:

Find a version that you like the look of (the newest, probably) and download the .zip file under that “Assets” dropdown.

Let’s get these both working, starting with Ciderpress:

  1. Unzip the downloaded file.

  2. Navigate to the folder in the terminal.

  3. Using the magic on Wine we can install the .exe file provided. To do this type the command wine Setup403.exe. If the .exe is not called the same thing for you then enter the appropriate name instead.

  4. Go through the installation process.

  5. Now, with Ciderpress installed navigate to: ~/.wine/drive_c/Program\ Files/. For me, this was where it was however it could be in another folder, potentially Program Files (x86).

  6. Inside you should be able to navigate to a Ciderpress folder. For me, it was located at Faddensoft/Ciderpress

  7. Finally, to run Ciderpress just type wine Ciderpress.exe

And like magic, Ciderpress, a Windows program, should be running on your Mac or Linux machine. The process to get AppleWin installed is even easier:

  1. Unzip the downloaded AppleWin file.

  2. Navigate to the folder in the terminal.

  3. The command wine applewin.exe should launch the application.

#software-engineering #apple #learning-to-code #gaming #programming

What is GEEK

Buddha Community

How to use an Apple ii!

Why Use WordPress? What Can You Do With WordPress?

Can you use WordPress for anything other than blogging? To your surprise, yes. WordPress is more than just a blogging tool, and it has helped thousands of websites and web applications to thrive. The use of WordPress powers around 40% of online projects, and today in our blog, we would visit some amazing uses of WordPress other than blogging.
What Is The Use Of WordPress?

WordPress is the most popular website platform in the world. It is the first choice of businesses that want to set a feature-rich and dynamic Content Management System. So, if you ask what WordPress is used for, the answer is – everything. It is a super-flexible, feature-rich and secure platform that offers everything to build unique websites and applications. Let’s start knowing them:

1. Multiple Websites Under A Single Installation
WordPress Multisite allows you to develop multiple sites from a single WordPress installation. You can download WordPress and start building websites you want to launch under a single server. Literally speaking, you can handle hundreds of sites from one single dashboard, which now needs applause.
It is a highly efficient platform that allows you to easily run several websites under the same login credentials. One of the best things about WordPress is the themes it has to offer. You can simply download them and plugin for various sites and save space on sites without losing their speed.

2. WordPress Social Network
WordPress can be used for high-end projects such as Social Media Network. If you don’t have the money and patience to hire a coder and invest months in building a feature-rich social media site, go for WordPress. It is one of the most amazing uses of WordPress. Its stunning CMS is unbeatable. And you can build sites as good as Facebook or Reddit etc. It can just make the process a lot easier.
To set up a social media network, you would have to download a WordPress Plugin called BuddyPress. It would allow you to connect a community page with ease and would provide all the necessary features of a community or social media. It has direct messaging, activity stream, user groups, extended profiles, and so much more. You just have to download and configure it.
If BuddyPress doesn’t meet all your needs, don’t give up on your dreams. You can try out WP Symposium or PeepSo. There are also several themes you can use to build a social network.

3. Create A Forum For Your Brand’s Community
Communities are very important for your business. They help you stay in constant connection with your users and consumers. And allow you to turn them into a loyal customer base. Meanwhile, there are many good technologies that can be used for building a community page – the good old WordPress is still the best.
It is the best community development technology. If you want to build your online community, you need to consider all the amazing features you get with WordPress. Plugins such as BB Press is an open-source, template-driven PHP/ MySQL forum software. It is very simple and doesn’t hamper the experience of the website.
Other tools such as wpFoRo and Asgaros Forum are equally good for creating a community blog. They are lightweight tools that are easy to manage and integrate with your WordPress site easily. However, there is only one tiny problem; you need to have some technical knowledge to build a WordPress Community blog page.

4. Shortcodes
Since we gave you a problem in the previous section, we would also give you a perfect solution for it. You might not know to code, but you have shortcodes. Shortcodes help you execute functions without having to code. It is an easy way to build an amazing website, add new features, customize plugins easily. They are short lines of code, and rather than memorizing multiple lines; you can have zero technical knowledge and start building a feature-rich website or application.
There are also plugins like Shortcoder, Shortcodes Ultimate, and the Basics available on WordPress that can be used, and you would not even have to remember the shortcodes.

5. Build Online Stores
If you still think about why to use WordPress, use it to build an online store. You can start selling your goods online and start selling. It is an affordable technology that helps you build a feature-rich eCommerce store with WordPress.
WooCommerce is an extension of WordPress and is one of the most used eCommerce solutions. WooCommerce holds a 28% share of the global market and is one of the best ways to set up an online store. It allows you to build user-friendly and professional online stores and has thousands of free and paid extensions. Moreover as an open-source platform, and you don’t have to pay for the license.
Apart from WooCommerce, there are Easy Digital Downloads, iThemes Exchange, Shopify eCommerce plugin, and so much more available.

6. Security Features
WordPress takes security very seriously. It offers tons of external solutions that help you in safeguarding your WordPress site. While there is no way to ensure 100% security, it provides regular updates with security patches and provides several plugins to help with backups, two-factor authorization, and more.
By choosing hosting providers like WP Engine, you can improve the security of the website. It helps in threat detection, manage patching and updates, and internal security audits for the customers, and so much more.

Read More

#use of wordpress #use wordpress for business website #use wordpress for website #what is use of wordpress #why use wordpress #why use wordpress to build a website

Maria Smith

1623919962

How can I get a human at Apple to report problem?

**How Do I Report a Problem to Apple Customer Service?
**

There are times when you may find some issue with your Apple product however you rarely see an issue. You can report a problem if you want to. All you need is to perform a few simple steps and here are the steps that you should perform. Go through them.

**How can I get human at Apple?
**

• First and foremost, you need to go to reportaproblem.apple.com.
• Next, you have to sign in to your Apple account by entering your Apple ID and Password.
• In case you see a Report or Report a Problem option next to the item in which you see a problem, click it.
• After that, you need to follow the onscreen instructions and select a reason why you want to report a problem.
• Lastly, you need to submit your request.

**How do you get through to Apple Support?
**

With this, you can report online for your Apple product. In case you want to contact Apple customer service to report a problem, you can do that in the given ways.

  1. Over a Phone Call - Dial the customer service phone number to get help for any problem that you see with your Apple account. Also, you can report the problem on a single phone call.
    You can speak to a human at Apple technical support: (800) APL–CARE (800–275–2273)
  2. Through Live Chat - By requesting a live chat, you will be in touch with a representative who will assist you thoroughly to report a problem that you see with your Apple account.
  3. Via Email - The most common way to report a problem on Apple is email. You can compose an email explaining the issue that you see with the service and report it. Once your email is received, the tech support team acknowledges the issue and provides you all information within the least possible time.

By choosing any of the desired ways to report a problem, you can complain about the issue to the tech support team (Apple customer service). Also, you will no longer wonder how to get a human at Apple support. The above information will help you in all manners and let you experience the hassle-free service of Apple. So, dial the number or send an email, but get help from the experts.

#how can i get a human at apple #how do i reach a human at apple? #how do i call apple support? #contact apple support #call apple support #apple's online support

Seamus  Quitzon

Seamus Quitzon

1593152820

Apple Pays $100K Bounty for Critical 'Sign in With Apple' Flaw

Apple has fixed a critical flaw in its Sign in with Apple feature, which could have been abused by attackers to takeover victims’ third-party applications.

A researcher recently found a critical Apple vulnerability that, if exploited, could enable remote attackers to abuse the “Sign in with Apple” feature to take over victims’ third-party application accounts. The security researcher, Bhavuk Jain, reported the flaw to Apple via its bug bounty program, and was awarded $100,000 for the find.

The flaw stemmed from the “Sign in with Apple” feature, which was introduced by Apple at its Worldwide Developers Conference last year. Sign in with Apple aimed to make it easy and secure for Apple users to sign into third-party apps and websites. It did this by implementing an Apple-backed authentication system to replace social logins on third-party services.

“In the month of April, I found a zero-day in Sign in with Apple that affected third-party applications which were using it and didn’t implement their own additional security measures,” said Jain, in his disclosure of the bug on Sunday. “This bug could have resulted in a full account takeover of user accounts on that third party application irrespective of a victim having a valid Apple ID or not.”

Apple has since fixed the flaw. Threatpost has reached out to Apple for further comment.

One of the highlights of Sign in with Apple is that users could sign up with third-party services without needing to disclose their Apple ID email address to these services. This worked because Sign in with Apple would first validate users on the client side, and then initiate a JSON Web Token (JWT) request from Apple’s authentication services. This JWT would then be used by the third-party app to confirm the user’s identity.

The issue was that after Apple validated the user on the client side via their Apple ID email address, it did not verify that the JWT request was from that actual user account. An attacker could abuse this flaw by providing an Apple ID email that belongs to the victim and tricking Apple servers into generating a valid JWT payload. Once an attacker does this, he can then sign into a third-party app using the victim’s identity.

apple critical flaw

“I found I could request JWTs for any Email ID from Apple and when the signature of these tokens was verified using Apple’s public key, they showed as valid,” he said. “This means an attacker could forge a JWT by linking any Email ID to it and gaining access to the victim’s account.”

According to The Hacker News, the flaw could be exploited even if users had decided to hide their email IDs from third-party services. It could also be exploited to sign up new accounts with victims’ Apple IDs.

There are two hoops that attackers would need to jump through to make this exploit work. First, they would need an email ID for an Apple user – though that could be any Apple user’s email ID. Second, they would need to log into a third-party app via Sign in with Apple that didn’t require any further security measures.

Jain said the impact of this vulnerability is “quite critical” as it could allow full account takeover. Many developers have integrated Sign in with Apple into their services, including Dropbox, Spotify, Airbnb, and Giphy.

“These applications were not tested but could have been vulnerable to a full account takeover if there weren’t any other security measures in place while verifying a user,” Jain said.

Jain said that Apple conducted an investigation of their logs and determined there was no misuse or account compromise due to this vulnerability. The researcher found the flaw in April and reported it via Apple’s bug bounty program which earned him $100,000. Threatpost has reached out to Jain for further details on the timeline of discovering and reporting the flaw.

#mobile security #vulnerabilities #web security #app takeover #apple #apple bug bounty #apple flaw #bug bounty #critical flaw #security vulnerability #sign in with apple #third party app

坂本  篤司

坂本 篤司

1641263820

Ansibleとは何ですか?

みなさん、こんにちは。今日は、クロスプラットフォームのコンピューターサポートをシンプルで効果的な方法で自動化できる素晴らしいソフトウェアツールであるAnsibleについてお話します。

Ansibleとは何ですか?

Ansibleは、システムインフラストラクチャ全体でITプロフェッショナルの作業を自動化するための書面による指示を生成するツールです。

これは、アプリケーションの展開、構成管理、サービス内オーケストレーション、およびシステム管理者が毎週または毎日行うその他の事実上すべてに使用するITプロフェッショナル向けに特別に設計されています。

Ansibleは、エージェントソフトウェアやその他のセキュリティインフラストラクチャを必要としないため、インストールが簡単です。

Ansibleは自動化、システム管理、DevOpsの最先端にありますが、開発者が日常業務で使用するためのツールとしても価値があります。

Ansibleを使用すると、1台のマシンだけでなく、それらすべての完全なネットワークを一度にセットアップでき、プログラミングの知識は必要ありません。

Ansibleはどのように機能しますか?

Ansibleはネットワーク上のノード(クライアント、サーバーなど)に接続し、Ansibleモジュールと呼ばれる小さなプログラムを各ノードに送信します。

次に、SSHを介してこれらのモジュールを実行し、完了したら削除します。

このインタラクションが機能するには、Ansibleコントロールノードが管理対象ノードへのログインアクセス権を持っている必要があります。

最も頻繁な認証方法はSSHキーですが、別の方法も許可されています。

Ansibleをインストールして使用を開始する方法を知りたい場合は、以下で説明します。

Ansibleのアーキテクチャ

それでは、Ansibleのアーキテクチャとそれがどのように操作を管理するかを見てみましょう。

Ansibleプラグイン

プラグインは機能を強化する補足的なコードであり、おそらく他の多くのツールやプラットフォームでプラグインを使用したことがあります。Ansibleの組み込みプラグインを使用することも、独自のプラグインを作成することもできます。

例は次のとおりです。

  • アクションプラグイン
  • プラグインになる
  • キャッシュプラグイン
  • コールバックプラグイン
  • Cliconfプラグイン
  • 接続プラグイン
  • HTTPAPIプラグイン
  • インベントリプラグイン
  • ルックアッププラグイン
  • Netconfプラグイン
  • テスト

Ansibleモジュール

モジュールは、Ansibleが中央制御ワークステーションからすべてのノードまたはリモートホストに配布する短いプログラムです。モジュールはサービスやパッケージなどを制御し、プレイブックを介して実行できます。

Ansibleは、更新をインストールしたり、必要な操作を完了したりするために必要なすべてのモジュールを実行し、完了後にそれらを削除します。

Ansibleインベントリ

Ansibleは、インベントリファイルを使用して、インフラストラクチャの一部であるホストを追跡し、それらにアクセスしてコマンドとプレイブックを実行します。

Ansibleは、インフラストラクチャ内のさまざまなシステムと並行して機能します。これは、デフォルトでホストの場所に保存されているAnsibleのインベントリファイルに記載されているメソッドを選択することで実現されます。

インベントリが登録されると、単純なテキストファイルを使用して任意のホストに変数を割り当てることができ、さまざまなソースからインベントリを取得できます。

Ansible Playbook

ITプロフェッショナルは、Ansibleプレイブックを使用して、アプリケーション、サービス、サーバーノード、およびその他のデバイスを最初から作成することなくプログラムできます。Ansibleプレイブックは、それらに含まれる条件、変数、およびタスクとともに、保存、共有、および永久に再利用できます。

Ansible Playbookは、タスクマニュアルと同様に機能します。これらは単純なYAMLファイルであり、人間が読める形式のデータシリアル化言語です。

プレイブックは、Ansibleを非常に人気のあるものにする中心的な要素です。これらは、ユーザーが特定の構文を知っているか覚えている必要なしに、迅速に完了することができるアクティビティを指定します。

Ansibleを使用する利点

  • Ansibleは、SSHを介してすべての操作を実行し、エージェントをインストールする必要がないため、すばやく簡単に使用できます。
  • Ansibleは無料のオープンソースツールであり、セットアップと使用が簡単です。Ansibleのプレイブックには、特別なコーディングの知識は必要ありません。
  • Ansibleを使用すると、構成ファイルを必要とせずに、サービスが動作していることを確認したり、コマンドラインから再起動したりするなどの簡単なタスクを実行できます。

より広範囲またはより均一なシステムでは、Ansibleの方が適している場合があります。また、さまざまなメソッドとクラウドインフラストラクチャを管理するための一連のモジュールも提供します。

なぜAnsibleはそれほど重要なのですか?

近代化とデジタルトランスフォーメーションには、必要かつ目的のある自動化が必要です。ITインフラストラクチャ全体の速度、拡張性、および安定性を向上させるために、今日の動的なコンテキストで新しい管理ソリューションが必要です。

テクノロジーは、製品を改善するための最も強力な手段です。以前は、これを達成するには、かなりの量の手作業と複雑な調整が必要でした。しかし今日、Ansible(セットアップを簡素化し、DevOps操作を高速化するために何千もの企業で使用されているシンプルで強力なIT自動化エンジン)が利用可能です。

UbuntuにAnsibleをインストールする方法

次のコマンドを実行して、マシンにPPAを構成し、Ansibleをインストールします。

リポジトリを更新します。

sudo apt-get update

ソフトウェアのプロパティをインストールします。

sudo apt-get install software-properties-common

そして、次のようにAnsibleをインストールします。

sudo apt-add-repository --yes --update ppa:ansible/ansible

次に、これを実行します。

sudo apt-get install ansible

以下に示すようなものが必要です。

ansible_installation

Ansibleが正常にインストールされたので、次のコマンドを使用して、Ansibleが機能しているかどうかをテストしましょう。

ansible --version

ansible_check

以下のコマンドを使用して、インベントリホストlocalhostのすべてのシステムをターゲットにするようにAnsibleに指示し、(sshではなく)ローカルコンソールからモジュールpingを実行します。

ansible all -i localhost, --connection=local -m ping

以下に示すような応答が得られるはずです。

ansible_ping

Ansibleがターゲットとするホストを変更する方法

のホストのファイルに変更を加えます/etc/ansible/hosts。これは、Ansibleが指定されたコマンドをリモートで実行する必要がある定義済みのホスト(およびグループ)を検索するデフォルトのファイルです。

sudo nano /etc/ansible/hosts

以下の行をファイルに追加し、変更を保存します。

[local]
localhost

調整したインベントリファイルを使用して次のコマンドを実行します。

ansible all --connection=local -m ping

応答は、以下のようになります。

ansible_pong

リモートサーバーを構成する方法

Digital Oceanドロップレットを使用して、Ansibleテストプログラムをリモートサーバーにデプロイします。

以下のコマンドを使用して、サーバーにSSH接続します。

ssh username@IP_Address

注:ドロップレットの作成時に選択されたsshキーはプロファイルにすでに構成されています。

ansible_server

リモートサーバー用にAnsibleを構成する方法

以下のコマンドを使用して、/ etc / ansible / hosts内のhostsファイルを編集します。

sudo nano /etc/ansible/hosts

以下の行をファイルに追加し、変更を保存します。

[remote]
remote_test

[remote:vars]
ansible_host=IP_ADDRESS_OF_VIRTUAL_MACHINE
ansible_user=USERNAME

AnsibleがSSH経由でリモートコンピューティングインスタンスに接続できるかどうかを確認するには、次のコマンドを入力してみましょう。

ansible remote -m ping

asnible_result

以下のコマンドを使用してAnsibleプレイブックを作成します。これは、リモートサーバーで実行するコマンドとその順序をAnsibleに指示する一般的な方法です。プレイブックは.ymlで記述されており、厳密な形式に従います。

公式のAnsibleドキュメントでは、プレイブックについて詳しく知ることができます。

nano my-playbook.yml

次のコードを追加します。これは、Ansibleにいくつかの手順でDockerをインストールするように指示します。

---
- name: install docker
hosts: remote
become_method: sudo
become_user: root
vars: #local variables
docker_packages:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common

tasks:
- name: Update apt packages
become: true #make sure you execute the task with sudo privileges
apt: #use apt module
update_cache: yes #equivalent of apt-get update

- name: Install packages needed for Docker
become: true
apt:
name: "{{ docker_packages }}" #uses our declared variable docker_packages
state: present #indicates the desired package state
force_apt_get: yes #forces to use apt-get

- name: Add official GPG key of Docker
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

- name: Save the current Ubuntu release version into a variable
shell: lsb_release -cs
register: ubuntu_version #Output gets stored in this variable

- name: Set right Docker directory
become: true
shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ubuntu_version.stdout }} stable"

- name: Update apt packages
become: true
apt:
update_cache: yes

- name: Install Docker
become: true
apt:
name: docker-ce
state: present
force_apt_get: yes

- name: Test Docker with hello world example
become: true
shell: docker run hello-world
register: hello_world_output

- name: Show output of hello word example
debug: #use debug module
msg: "Container Output: {{hello_world_output.stdout}}"

これで、次のコマンドで実行できます。

ansible-playbook my-playbook.yml -l remote

その後、いくつかの魔法が発生し(しばらく時間がかかる場合があります)、ターミナルの最後のデバッグメッセージのどこかに、「Hello fromDocker!」と表示されるはずです。

結論

この記事では、Ansible、その利点、動作と機能、アーキテクチャ、プラグイン、プレイブック、インベントリ、およびリモートサーバーでAnsibleを使用してDockerを構成およびデプロイする方法について詳しく説明しました。

読んでくれてありがとう!

リンク:https//www.freecodecamp.org/news/what-is-ansible/

#ansible 

What is Ansible? A Tool to Automate Parts of Your Job

Hello everyone, today we will talk about Ansible, a fantastic software tool that allows you to automate cross-platform computer support in a simple but effective way.

Table of Contents

  • What is Ansible?
  • How Does Ansible Work?
  • Ansible's Architecture
    • Plugins
    • Modules
    • Inventories
    • Playbook
  • Benefits of Using Ansible
  • Why is Ansible so important?
  • How to Install and Configure Ansible on Ubuntu
  • Conclusion
  • References

What is Ansible?

Ansible is a tool that generates written instructions for automating IT professionals' work throughout the entire system infrastructure.

It's designed particularly for IT professionals who use it for application deployment, configuration management, intra-service orchestration, and practically anything else a systems administrator does on a weekly or daily basis.

Ansible is simple to install because it doesn't require any agent software or other security infrastructure.

While Ansible is at the cutting edge of automation, systems administration, and DevOps, it's also valuable as a tool for devs to use in their daily work.

Ansible allows you to set up not just one machine but a complete network of them all at once, and it doesn't require any programming knowledge.

How Does Ansible Work?

Ansible connects to nodes on a network (clients, servers, etc.) and then send a little program called an Ansible module to each node.

It then runs these modules through SSH and deletes them once they're done.

Your Ansible control node must have login access to the managed nodes for this interaction to work.

The most frequent method of authentication is SSH keys, but alternative methods are also allowed.

If you want to see how to install and start using Ansible, we'll cover that below.

Ansible's Architecture

Now let's take a look at Ansible's architecture and how it manages operations.

Ansible Plugins

Plugins are supplementary pieces of code that enhance functionality, and you've probably used them in many other tools and platforms. You can use Ansible's built-in plugins or create your own.

Examples are:

  • Action Plugins
  • Become Plugins
  • Cache Plugins
  • Callback Plugins
  • Cliconf Plugins
  • Connection Plugins
  • HTTP API Plugins
  • Inventory Plugins
  • Lookup Plugins
  • Netconf Plugins
  • Tests

Ansible Modules

Modules are short programs that Ansible distributes to all nodes or remote hosts from a central control workstation. Modules control things like services and packages and can be executed via playbooks.

Ansible runs all of the modules needed to install updates or complete whatever operation is required and then removes them after they're done.

Ansible Inventories

Ansible uses an inventory file to track which hosts are part of your infrastructure and then accesses them to perform commands and playbooks.

Ansible works in parallel with various systems in your infrastructure. It accomplishes this by picking methods mentioned in Ansible's inventory file, which is saved in the host location by default.

Once the inventory is registered, you can use a simple text file to assign variables to any of the hosts, and you may retrieve inventory from a variety of sources.

Ansible Playbook

IT professionals can use Ansible playbooks to program applications, services, server nodes, and other devices without starting from scratch. Ansible playbooks, along with the conditions, variables, and tasks included within them, can be stored, shared, and reused forever.

Ansible playbooks function similarly to task manuals. They're simple YAML files, a human-readable data serialization language.

Playbooks are at the heart of what makes Ansible so popular. They specify activities that can be completed quickly without requiring the user to know or remember any specific syntax.

Benefits of Using Ansible

  • Ansible is quick and easy to use, as it runs all of its operations over SSH and doesn't require the installation of any agents.
  • Ansible is a free, open-source tool, and it's straightforward to set up and use: Ansible's playbooks don't require any special coding knowledge.
  • Ansible can be used to perform simple tasks such as ensuring that a service is operating or rebooting from the command line without the need for configuration files.

In a more extensive or more uniform system, Ansible may be a better fit. It also provides a set of modules for managing various methods and cloud infrastructure.

Why is Ansible so important?

Modernization and digital transformation require automation that's both necessary and purposeful. We need a new management solution in today's dynamic contexts to increase speed, scale, and stability throughout IT infrastructure.

Technology is our most potent instrument for product improvement. Previously, accomplishing this required a significant amount of manual labor and intricate coordination. But today, Ansible - a simple yet powerful IT automation engine used by thousands of enterprises to simplify their setups and speed DevOps operations - is available.

How to Install Ansible on Ubuntu

Run the following commands to configure the PPA on your machine and install Ansible:

Update the repository:

sudo apt-get update

Install the software properties:

sudo apt-get install software-properties-common

And then install Ansible like this:

sudo apt-add-repository --yes --update ppa:ansible/ansible

Then run this:

sudo apt-get install ansible

You should have something similar to what is shown below:

ansible_installation

Now that you have successfully installed Ansible, let's test if it's working by using the command below:

ansible --version

ansible_check

We'll use the command below to instruct Ansible to target all systems for the inventory host localhost, and we'll run the module ping from your local console (rather than ssh).

ansible all -i localhost, --connection=local -m ping

You should get a response similar to what you can see below:

ansible_ping

How to modify the hosts that Ansible targets

We'll make changes to the host's file in /etc/ansible/hosts. This is the default file where Ansible searches for any defined hosts (and groups) where the given commands should be executed remotely.

sudo nano /etc/ansible/hosts

Add the lines below to the file and save the modifications:

[local]
localhost

Execute this command with your adjusted inventory file:

ansible all --connection=local -m ping

The response should look similar to what we have below:

ansible_pong

How to configure a remote server

We deploy our Ansible test program to our remote server using a Digital Ocean droplet.

Use the command below to ssh into the server:

ssh username@IP_Address

Note: we have already configured an ssh key in our profile, which was selected when creating the droplet.

ansible_server

How to configure Ansible for a remote server

We will edit our hosts file in /etc/ansible/hosts using the command below:

sudo nano /etc/ansible/hosts

Add the lines below to the file and save the modifications:

[remote]
remote_test

[remote:vars]
ansible_host=IP_ADDRESS_OF_VIRTUAL_MACHINE
ansible_user=USERNAME

To see if Ansible can connect to your remote compute instance over SSH, let's type the following command:

ansible remote -m ping

asnible_result

We'll make an Ansible playbook using the command below, which is the typical way of telling Ansible which commands to run on the remote server and in what order. The playbook is written in .yml and follows a strict format.

In the official Ansible documentation, you can learn more about playbooks.

nano my-playbook.yml

Add the following code, which tells Ansible to install Docker in several steps:

---
- name: install docker
hosts: remote
become_method: sudo
become_user: root
vars: #local variables
docker_packages:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common

tasks:
- name: Update apt packages
become: true #make sure you execute the task with sudo privileges
apt: #use apt module
update_cache: yes #equivalent of apt-get update

- name: Install packages needed for Docker
become: true
apt:
name: "{{ docker_packages }}" #uses our declared variable docker_packages
state: present #indicates the desired package state
force_apt_get: yes #forces to use apt-get

- name: Add official GPG key of Docker
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

- name: Save the current Ubuntu release version into a variable
shell: lsb_release -cs
register: ubuntu_version #Output gets stored in this variable

- name: Set right Docker directory
become: true
shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ubuntu_version.stdout }} stable"

- name: Update apt packages
become: true
apt:
update_cache: yes

- name: Install Docker
become: true
apt:
name: docker-ce
state: present
force_apt_get: yes

- name: Test Docker with hello world example
become: true
shell: docker run hello-world
register: hello_world_output

- name: Show output of hello word example
debug: #use debug module
msg: "Container Output: {{hello_world_output.stdout}}"

We can now execute it with the command below:

ansible-playbook my-playbook.yml -l remote

After that, we'll see some magic happen (it might take a while), and somewhere in the last debug message in our terminal, we should see "Hello from Docker!"

Conclusion

In this article, we had a detailed look into Ansible, its benefits, how it works and what it can do, its architecture, plugins, playbook, inventory, and how to configure and deploy Docker with Ansible on a remote server.

Thank you for reading!

Link: https://www.freecodecamp.org/news/what-is-ansible/

#ansible